Merge pull request #43 from EndangeredMassa/master

fix setIndex to include last item
This commit is contained in:
Christopher Jeffrey 2014-06-05 01:28:38 -05:00
commit 458e4dfdea
1 changed files with 2 additions and 5 deletions

View File

@ -2329,11 +2329,8 @@ Element.prototype.setIndex = function(index) {
var i = this.parent.children.indexOf(this);
if (!~i) return;
this.parent.children.splice(index, 0, this);
if (index <= i) i++;
this.parent.children.splice(i, 1);
var item = this.parent.children.splice(i, 1)[0]
this.parent.children.splice(index, 0, item);
};
Element.prototype.setFront = function() {