From b5c7aed3adcbe0a6aeb1161b987ba526085f5493 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 2 Aug 2013 15:17:50 -0500 Subject: [PATCH] clean up old code. --- lib/widget.js | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index 6765d42..ac1c742 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -204,7 +204,6 @@ Node.prototype.emitAncestors = function() { }; Node.prototype.hasDescendant = function(target) { - // return this.collectDescendants().indexOf(target) !== -1; return (function find(el) { for (var i = 0; i < el.children.length; i++) { if (el.children[i] === target) { @@ -219,7 +218,6 @@ Node.prototype.hasDescendant = function(target) { }; Node.prototype.hasAncestor = function(target) { - // return this.collectAncestors().indexOf(target) !== -1; var el = this; while (el = el.parent) { if (el === target) return true; @@ -227,18 +225,6 @@ Node.prototype.hasAncestor = function(target) { return false; }; -Node.prototype.gon = function(type, callback) { - var self = this - , events = this._events || {} - , listeners = (events[type] || []).slice(); - - return this.on(type, function() { - if (callback.apply(this, arguments) === true) { - self._events[type] = listeners; - } - }); -}; - Node.prototype.get = function(name, value) { if (this.data.hasOwnProperty(name)) { return this.data[name]; @@ -441,10 +427,6 @@ Screen.prototype._listenMouse = function(el) { if (el && !~this.clickable.indexOf(el)) { el.clickable = true; - // if (el.options.autoFocus !== false && !el._autoFocused) { - // el._autoFocused = true; - // el.on('element click', el.focus.bind(el)); - // } this.clickable.push(el); } @@ -543,16 +525,6 @@ Screen.prototype._listenKeys = function(el) { if (el && !~this.keyable.indexOf(el)) { el.keyable = true; - // Listen for click, but do not enable - // mouse if it's not enabled yet. - // if (el.options.autoFocus !== false && !el._autoFocused) { - // el._autoFocused = true; - // var lm = this._listenedMouse; - // this._listenedMouse = true; - // this._listenMouse(el); - // el.on('element click', el.focus.bind(el)); - // this._listenedMouse = lm; - // } this.keyable.push(el); } @@ -1302,11 +1274,6 @@ Screen.prototype.attrCode = function(code, cur, def) { } } - // Ignore foreground changes for selected items. - // if (el && el.parent._isList && el.parent.items[el.parent.selected] === el) { - // fg = (def >> 9) & 0x1ff; - // } - return (flags << 18) | (fg << 9) | bg; };