return tagless values for list items.

This commit is contained in:
Christopher Jeffrey 2015-04-22 16:57:27 -07:00
parent 2e5da439b0
commit fdf181b8e0

View File

@ -5381,7 +5381,7 @@ List.prototype.fuzzyFind = function(search, back) {
}
if (!back) {
for (var i = start; i < this.ritems.length; i++){
for (var i = start; i < this.items.length; i++){
if (test(this.items[i].getText())) return i;
}
for (var i = 0; i < start; i++){
@ -5403,7 +5403,14 @@ List.prototype.getItemIndex = function(child) {
if (typeof child === 'number') {
return child;
} else if (typeof child === 'string') {
return this.ritems.indexOf(child);
var i = this.ritems.indexOf(child);
if (~i) return i;
for (i = 0; i < this.items.length; i++) {
if (this.items[i].getText() === child) {
return i;
}
}
return -1;
} else {
return this.items.indexOf(child);
}
@ -5489,7 +5496,7 @@ List.prototype.select = function(index) {
this._listInitialized = true;
this.selected = index;
this.value = this.ritems[this.selected];
this.value = this.items[this.selected].getText();
if (!this.parent) return;
this.scrollTo(this.selected);
};
@ -5537,7 +5544,7 @@ List.prototype.pick = function(label, callback) {
self.hide();
self.screen.render();
if (!el) return callback();
return callback(null, self.ritems[selected]);
return callback(null, self.items[selected].getText());
});
};