mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-11 03:25:45 +00:00
Merge pull request #43 from EndangeredMassa/master
fix setIndex to include last item
This commit is contained in:
commit
458e4dfdea
@ -2329,11 +2329,8 @@ Element.prototype.setIndex = function(index) {
|
|||||||
var i = this.parent.children.indexOf(this);
|
var i = this.parent.children.indexOf(this);
|
||||||
if (!~i) return;
|
if (!~i) return;
|
||||||
|
|
||||||
this.parent.children.splice(index, 0, this);
|
var item = this.parent.children.splice(i, 1)[0]
|
||||||
|
this.parent.children.splice(index, 0, item);
|
||||||
if (index <= i) i++;
|
|
||||||
|
|
||||||
this.parent.children.splice(i, 1);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Element.prototype.setFront = function() {
|
Element.prototype.setFront = function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user