diff options
author | wout <wout@impinc.co.uk> | 2012-12-29 18:12:53 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-29 18:12:53 +0100 |
commit | 68367e494fcab754ae4833e64804a824032cf31c (patch) | |
tree | c9d5d9fe5995ccbbe819f29752c1133c7415882d /src/arrange.js | |
parent | 52ed3ba98715ed3c63e74ff29a9892972a7bec19 (diff) | |
download | svg.js-68367e494fcab754ae4833e64804a824032cf31c.tar.gz svg.js-68367e494fcab754ae4833e64804a824032cf31c.zip |
Code refactoring
Diffstat (limited to 'src/arrange.js')
-rw-r--r-- | src/arrange.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/arrange.js b/src/arrange.js index 001da75..ac53e43 100644 --- a/src/arrange.js +++ b/src/arrange.js @@ -2,7 +2,7 @@ // add backward / forward functionality to elements SVG.extend(SVG.Element, { - // get all siblings, including me + // get all siblings, including myself siblings: function() { return this.parent.children(); }, @@ -10,9 +10,8 @@ SVG.extend(SVG.Element, { // send given element one step forwards forward: function() { var i = this.siblings().indexOf(this); - this.parent.remove(this).add(this, i + 1); - return this; + return this.parent.remove(this).put(this, i + 1); }, // send given element one step backwards @@ -29,9 +28,7 @@ SVG.extend(SVG.Element, { // send given element all the way to the front front: function() { - this.parent.remove(this).add(this); - - return this; + return this.parent.remove(this).put(this); }, // send given element all the way to the back |