updateChoices :
Ajax.Autocompleter.prototype.updateChoices = function (choices) {
if(!this.changed && this.hasFocus) {
if(!choices) {
}
else {
this.update.innerHTML = choices;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.down());
if(this.update.firstChild && this.update.down().childNodes) {
this.entryCount =
this.update.down().childNodes.length;
for (var i = 0; i < this.entryCount; i++) {
var entry = this.getEntry(i);
entry.autocompleteIndex = i;
this.addObservers(entry);
}
} else {
this.entryCount = 0;
}
this.stopIndicator();
this.index = 0;
if(this.entryCount==1 && this.options.autoSelect) {
this.selectEntry();
this.hide();
} else {
this.render();
}
}
}
}
controls.js. .js .
: pff.. , / TextMate . , . , ,
if(!choices) {
//do your "new item" thing here
}
else {}
. , , , .