From 2539527864e19ad0ad4122700090e8a27385a948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 6 Jan 2016 15:25:37 +0100 Subject: [PATCH] Fix minification warnings. --- src/item/Item.js | 4 ++-- src/item/Layer.js | 2 +- src/item/Shape.js | 2 +- src/path/Path.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index d7f366b2..a39d7e48 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1445,7 +1445,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ if (!children) copy.copyAttributes(this); // Insert is true by default. - if (insert != false) // No double-equal! + if (insert === undefined || insert) copy.insertAbove(this); // Make sure we're not overriding the original name in the same parent var name = this._name, @@ -1589,7 +1589,7 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ raster.transform(new Matrix().translate(topLeft.add(size.divide(2))) // Take resolution into account and scale back to original size. .scale(1 / scale)); - if (insert != false) // No double-equal! + if (insert === undefined || insert) raster.insertAbove(this); return raster; }, diff --git a/src/item/Layer.js b/src/item/Layer.js index 815f70c1..a17c1c98 100644 --- a/src/item/Layer.js +++ b/src/item/Layer.js @@ -70,7 +70,7 @@ var Layer = Group.extend(/** @lends Layer# */{ // Call the group constructor but don't insert yet! props.insert = false; Group.call(this, props); - if (insert != false) { // No double-equal! + if (insert === undefined || insert) { this._project.addChild(this); // When inserted, also activate the layer by default. this.activate(); diff --git a/src/item/Shape.js b/src/item/Shape.js index 817b4aee..675cf375 100644 --- a/src/item/Shape.js +++ b/src/item/Shape.js @@ -180,7 +180,7 @@ var Shape = Item.extend(/** @lends Shape# */{ // Respect the setting of paper.settings.applyMatrix for new paths: if (paper.settings.applyMatrix) path.setApplyMatrix(true); - if (insert != false) // No double-equal! + if (insert === undefined || insert) path.insertAbove(this); return path; }, diff --git a/src/path/Path.js b/src/path/Path.js index 0a140c54..d41f3084 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1515,7 +1515,7 @@ var Path = PathItem.extend(/** @lends Path# */{ shape._matrix.preConcatenate(this._matrix); // Determine and apply the shape's angle of rotation. shape.rotate(topCenter.subtract(center).getAngle() + 90); - if (insert != false) // No double-equal! + if (insert === undefined || insert) shape.insertAbove(this); return shape; }