From c0733373d278cbf08997f82a5a22e56580354141 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Mon, 19 Jan 2009 09:36:35 +0000 Subject: 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 --- share/www/script/jquery.suggest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3