summaryrefslogtreecommitdiff
path: root/share/www/script/jquery.suggest.js
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-01-16 18:01:33 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-01-16 18:01:33 +0000
commit4c921ff6730e63a17c5be5b5ac01da44818833a4 (patch)
treeebe20333ea267b7904c1b58ea140bd5dc9703b1f /share/www/script/jquery.suggest.js
parent4bd235f6ddcce66a6f0cba753702ff6f47088ccb (diff)
Fix for autocompletion in "Save as" dialog in Futon to work with the changed `_all_docs` collation.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735071 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/jquery.suggest.js')
-rw-r--r--share/www/script/jquery.suggest.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/share/www/script/jquery.suggest.js b/share/www/script/jquery.suggest.js
index bc0dfbf8..cc8fe549 100644
--- a/share/www/script/jquery.suggest.js
+++ b/share/www/script/jquery.suggest.js
@@ -38,7 +38,6 @@
if ($.inArray(e.keyCode, [38, 40]) != -1 ||
(dropdown.is(":visible") && (e.keyCode == 27 ||
($.inArray(e.keyCode, [9, 13]) != -1 && getSelection())))) {
- e.preventDefault(); e.stopPropagation();
switch(e.keyCode) {
case 38: // up
moveUp();
@@ -49,11 +48,13 @@
case 9: // tab
case 13: // return
commit();
+ if (e.keyCode == 9) return true;
break;
case 27: // escape
dropdown.hide();
break;
}
+ e.preventDefault(); e.stopPropagation();
return false;
} else {
timer = setTimeout(function() { suggest() }, options.delay);
@@ -120,11 +121,12 @@
}
$.fn.suggest = function(callback, options) {
- options = options || {};
- options.callback = callback;
- options.delay = options.delay || 100;
- options.dropdownClass = options.dropdownClass || "suggest-dropdown";
- options.minChars = options.minChars || 1;
+ options = $.extend({
+ callback: callback,
+ delay: 100,
+ dropdownClass: "suggest-dropdown",
+ minChars: 1
+ }, options || {});
return this.each(function() {
suggest(this, options);
});