diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arrange.js | 12 | ||||
-rw-r--r-- | src/svg.js | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/arrange.js b/src/arrange.js index 1ec3561..441a9c3 100644 --- a/src/arrange.js +++ b/src/arrange.js @@ -4,7 +4,7 @@ SVG.extend(SVG.Element, { // Get all siblings, including myself siblings: function() { - return (this.nested() || this.doc()).children(); + return this.parent.children(); }, // Get the curent position siblings position: function() { @@ -24,12 +24,14 @@ SVG.extend(SVG.Element, { }, // Send given element one step backward backward: function() { - var i, parent = this.parent.level(); + var i; + + this.parent.level(); i = this.position(); if (i > 1) - parent.remove(this).add(this, i - 1); + this.parent.remove(this).add(this, i - 1); return this; }, @@ -39,10 +41,10 @@ SVG.extend(SVG.Element, { }, // Send given element all the way to the back back: function() { - var parent = this.parent.level(); + this.parent.level(); if (this.position() > 1) - parent.remove(this).add(this, 0); + this.parent.remove(this).add(this, 0); return this; } @@ -27,7 +27,7 @@ this.SVG = { // Method for extending objects extend: function(object, module) { /* extend all container modules */ - if (object === SVG.Container) + if (object == SVG.Container) ('Clip Defs Doc Gradient Group Mask Nested Pattern').split(' ').forEach(function(m) { if (SVG[m]) SVG.extend(SVG[m], module); |