aboutsummaryrefslogtreecommitdiff
path: root/js/components/hintable.reel/hintable.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-18 19:12:32 -0700
committerArmen Kesablyan2012-06-18 19:12:32 -0700
commit1b2e102b3519994c79b63be44fccb79cf5712fef (patch)
treef38534a7d8a3dc75909419a4bd823db73f771435 /js/components/hintable.reel/hintable.js
parent2fcb74d0b204ce2999b70fa9a46fc58a558344d8 (diff)
parente04903ed2d2e6754119550cb071e03878bb1b14b (diff)
downloadninja-1b2e102b3519994c79b63be44fccb79cf5712fef.tar.gz
Merge pull request #16 from ericguzman/binding
Objects Tray - Moved to stage object from binding view
Diffstat (limited to 'js/components/hintable.reel/hintable.js')
-rw-r--r--js/components/hintable.reel/hintable.js36
1 files changed, 1 insertions, 35 deletions
diff --git a/js/components/hintable.reel/hintable.js b/js/components/hintable.reel/hintable.js
index e16c5f8a..d09cdbd2 100644
--- a/js/components/hintable.reel/hintable.js
+++ b/js/components/hintable.reel/hintable.js
@@ -140,15 +140,6 @@ exports.Hintable = Montage.create(Editable, {
140 } 140 }
141 } 141 }
142 }, 142 },
143 value : {
144 get: function() {
145 return this._getFirstTextNode().textContent;
146 },
147 set: function(str) {
148 var node = this._getFirstTextNode();
149 node.textContent = str;
150 }
151 },
152 143
153 handleKeydown : { 144 handleKeydown : {
154 value : function handleKeydown(e) { 145 value : function handleKeydown(e) {
@@ -196,6 +187,7 @@ exports.Hintable = Montage.create(Editable, {
196 187
197 this._matchIndex = 0; 188 this._matchIndex = 0;
198 this.matches = this.hints.filter(function(h) { 189 this.matches = this.hints.filter(function(h) {
190 if(!h) { return false; }
199 return h.indexOf(val) === 0; 191 return h.indexOf(val) === 0;
200 }).sort(); 192 }).sort();
201 193
@@ -271,32 +263,6 @@ exports.Hintable = Montage.create(Editable, {
271 return Array.prototype.slice.call(arrayLikeObj); 263 return Array.prototype.slice.call(arrayLikeObj);
272 } 264 }
273 }, 265 },
274 _getFirstTextNode : {
275 value : function(el) {
276 ///// optional el argument specified container element
277 var e = el || this._element,
278 nodes = e.childNodes, node;
279
280 if(nodes.length) {
281 for(var i=0; i<nodes.length; i++) {
282 if(nodes[i].nodeType === 3) {
283 ///// found the first text node
284 node = nodes[i];
285 break;
286 }
287 }
288 }
289
290 ///// Text node not found
291 if(!node) {
292 node = document.createTextNode('');
293 e.appendChild(node);
294 }
295
296
297 return node;
298 }
299 },
300 _super : { 266 _super : {
301 value : function(args) { 267 value : function(args) {
302 this.inheritsFrom[arguments.callee.caller.name].apply(this, args); 268 this.inheritsFrom[arguments.callee.caller.name].apply(this, args);