mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-24 01:38:54 +00:00
fix clearPos and clickable/keyable check on removal. fixes #6.
This commit is contained in:
parent
599b186614
commit
8c558dbf3f
@ -109,20 +109,16 @@ Node.prototype.remove = function(element) {
|
||||
var i = this.children.indexOf(element);
|
||||
if (!~i) return;
|
||||
|
||||
if (this.type !== 'screen') {
|
||||
this.clearPos();
|
||||
}
|
||||
element.clearPos();
|
||||
|
||||
element.parent = null;
|
||||
|
||||
this.children.splice(i, 1);
|
||||
|
||||
if (this.type !== 'screen') {
|
||||
i = this.screen.clickable.indexOf(element);
|
||||
if (~i) this.screen.clickable.splice(i, 1);
|
||||
i = this.screen.keyable.indexOf(element);
|
||||
if (~i) this.screen.keyable.splice(i, 1);
|
||||
}
|
||||
i = this.screen.clickable.indexOf(element);
|
||||
if (~i) this.screen.clickable.splice(i, 1);
|
||||
i = this.screen.keyable.indexOf(element);
|
||||
if (~i) this.screen.keyable.splice(i, 1);
|
||||
|
||||
element.emit('reparent', null);
|
||||
this.emit('remove', element);
|
||||
|
Loading…
x
Reference in New Issue
Block a user