summaryrefslogtreecommitdiff
path: root/share/www/script/jquery.suggest.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-01-19 09:36:35 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-01-19 09:36:35 +0000
commitc0733373d278cbf08997f82a5a22e56580354141 (patch)
tree30c66a8bf00018992223d86cc8c8f09adfec9468 /share/www/script/jquery.suggest.js
parent197f85129a45073ea48088d1984e4d43707c287c (diff)
Add on-select callback to Futon autocompletion plugin.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735639 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/jquery.suggest.js')
-rw-r--r--share/www/script/jquery.suggest.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/share/www/script/jquery.suggest.js b/share/www/script/jquery.suggest.js
index 54217390..3a9d0ead 100644
--- a/share/www/script/jquery.suggest.js
+++ b/share/www/script/jquery.suggest.js
@@ -102,6 +102,9 @@
if (sel) {
prevVal = sel.data("value");
input.val(prevVal);
+ if (options.select) {
+ options.select.apply(elem, [prevVal]);
+ }
dropdown.hide();
}
if (timer) clearTimeout(timer)
@@ -133,7 +136,8 @@
callback: callback,
delay: 100,
dropdownClass: "suggest-dropdown",
- minChars: 1
+ minChars: 1,
+ select: null
}, options || {});
return this.each(function() {
suggest(this, options);