Skip to content

Commit

Permalink
Fixed typo and added docs for opt.insertText.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuel committed Nov 22, 2009
1 parent f1c0f39 commit 30be802
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jquery.ui.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@
container.remove();
},
template: function(str) { return "<li>" + opt.insertText(str) + "</li>"; },
insertText: function(str) { return str; }
/**
* Provide a value for the text input from the active object,
* also used to fill the li element in the default _template_ implementation
*
* @param str active item in the list
*/
insertText: function(item) { return item; }
}, opt);

/*
Expand Down Expand Up @@ -283,7 +289,7 @@
.addClass("active");
if (active.length) {
input.triggerHandler("itemSelected.autocomplete", [$.data(active[0], "originalObject"), active]);
input.val(opt.inputText($.data(active[0], "originalObject")));
input.val(opt.insertText($.data(active[0], "originalObject")));
}
};

Expand Down

0 comments on commit 30be802

Please sign in to comment.