Skip to content

Commit

Permalink
use defaults function
Browse files Browse the repository at this point in the history
  • Loading branch information
arose committed Oct 5, 2016
1 parent f6a021a commit dfe3c64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/component/shape-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import { defaults } from "../utils.js";
import Component from "./component.js";


Expand All @@ -19,7 +20,7 @@ import Component from "./component.js";
function ShapeComponent( stage, shape, params ){

var p = params || {};
p.name = p.name !== undefined ? p.name : shape.name;
p.name = defaults( p.name, shape.name );

Component.call( this, stage, p );

Expand Down
5 changes: 3 additions & 2 deletions src/component/structure-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import { defaults } from "../utils.js";
import Component from "./component.js";
import TrajectoryComponent from "./trajectory-component.js";
import { makeTrajectory } from "../trajectory/trajectory-utils.js";
Expand Down Expand Up @@ -33,7 +34,7 @@ import { superpose } from "../align/align-utils.js";
function StructureComponent( stage, structure, params ){

var p = params || {};
p.name = p.name !== undefined ? p.name : structure.name;
p.name = defaults( p.name, structure.name );

Component.call( this, stage, p );

Expand Down Expand Up @@ -239,7 +240,7 @@ StructureComponent.prototype = Object.assign( Object.create(

centerView: function( zoom, sele ){

zoom = zoom !== undefined ? zoom : true;
zoom = defaults( zoom, true );

var center = this.getCenter( sele );

Expand Down

0 comments on commit dfe3c64

Please sign in to comment.