summaryrefslogtreecommitdiffstats
path: root/src/arrange.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-29 13:55:53 +0100
committerwout <wout@impinc.co.uk>2013-01-29 13:55:53 +0100
commit610e40c62cfbd704db39c1516320de5cf61e36bd (patch)
tree9e64174bb981e748b958db1b61e65c92ecefda2c /src/arrange.js
parent293ef89f8d00d1623d8d2edd79d3af7bc765c002 (diff)
downloadsvg.js-610e40c62cfbd704db39c1516320de5cf61e36bd.tar.gz
svg.js-610e40c62cfbd704db39c1516320de5cf61e36bd.zip
Fix in arrange module
Diffstat (limited to 'src/arrange.js')
-rw-r--r--src/arrange.js12
1 files changed, 7 insertions, 5 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;
}