summaryrefslogtreecommitdiffstats
path: root/src/arrange.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-29 18:12:53 +0100
committerwout <wout@impinc.co.uk>2012-12-29 18:12:53 +0100
commit68367e494fcab754ae4833e64804a824032cf31c (patch)
treec9d5d9fe5995ccbbe819f29752c1133c7415882d /src/arrange.js
parent52ed3ba98715ed3c63e74ff29a9892972a7bec19 (diff)
downloadsvg.js-68367e494fcab754ae4833e64804a824032cf31c.tar.gz
svg.js-68367e494fcab754ae4833e64804a824032cf31c.zip
Code refactoring
Diffstat (limited to 'src/arrange.js')
-rw-r--r--src/arrange.js9
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