remove _isScreen.

This commit is contained in:
Christopher Jeffrey 2013-07-03 18:47:55 -05:00
parent 6ec3534fcd
commit 05216eadbb
1 changed files with 6 additions and 7 deletions

View File

@ -41,7 +41,7 @@ function Node(options) {
(options.children || []).forEach(this.append.bind(this));
if (this._isScreen && !this.focused) {
if (this.type === 'screen' && !this.focused) {
this.focused = this.children[0];
}
@ -67,7 +67,7 @@ Node.prototype.prepend = function(element) {
element.detach();
element.parent = this;
if (this._isScreen && !this.focused) {
if (this.type === 'screen' && !this.focused) {
this.focused = element;
}
@ -96,7 +96,7 @@ Node.prototype.append = function(element) {
element.detach();
element.parent = this;
if (this._isScreen && !this.focused) {
if (this.type === 'screen' && !this.focused) {
this.focused = element;
}
@ -127,14 +127,14 @@ Node.prototype.remove = function(element) {
this.children.splice(i, 1);
}
if (!this._isScreen) {
if (this.type !== 'screen') {
i = this.screen.clickable.indexOf(element);
if (~i) this.screen.clickable.splice(i, 1);
i = this.screen.input.indexOf(element);
if (~i) this.screen.input.splice(i, 1);
}
if (this._isScreen && this.focused === element) {
if (this.type === 'screen' && this.focused === element) {
this.focused = this.children[0];
}
@ -238,7 +238,6 @@ function Screen(options) {
Node.call(this, options);
this._isScreen = true;
this.program = options.program;
this.tput = this.program.tput;
this.dattr = ((0 << 18) | (0x1ff << 9)) | 0x1ff;
@ -1091,7 +1090,7 @@ Element.prototype.__defineGetter__('visible', function() {
Element.prototype.__defineGetter__('detached', function() {
var el = this;
do {
if (el._isScreen) return false;
if (el.type === 'screen') return false;
if (!el.parent) return true;
} while (el = el.parent);
return false;