summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-01-22 13:18:58 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-01-22 13:18:58 +0000
commit9a767782db4ba183dddf03567a1f05ce170d094b (patch)
treeae28017638f87e44c24a857a3d17ae0f268e16dc /share
parent3de248e62554b399cfa658d9ac1cf088d0b66381 (diff)
Autocompletion in Futon: a better fix for positioning in scrollable containers.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@736632 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/jquery.suggest.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/share/www/script/jquery.suggest.js b/share/www/script/jquery.suggest.js
index b414738f..824326c3 100644
--- a/share/www/script/jquery.suggest.js
+++ b/share/www/script/jquery.suggest.js
@@ -1,3 +1,5 @@
+// http://svn.apache.org/repos/asf/couchdb/trunk/share/www/script/jquery.suggest.js
+//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
@@ -12,7 +14,7 @@
(function($) {
- suggest = function(elem, options) {
+ function suggest(elem, options) {
var timer = null;
var prevVal = null;
var cache = {};
@@ -20,7 +22,7 @@
var input = $(elem).attr("autocomplete", "off");
var dropdown = $('<ul style="display: none; position: absolute; z-index: 10000"></ul>')
- .addClass(options.dropdownClass).insertAfter(input);
+ .addClass(options.dropdownClass).appendTo(document.body);
input
.blur(function() {
@@ -86,9 +88,9 @@
function show(items, render) {
if (!items) return;
if (!items.length) { dropdown.hide(); return; }
- var pos = input.position();
+ var offset = input.offset();
dropdown.empty().css({
- top: (pos.top + input.outerHeight()) + "px", left: pos.left + "px",
+ top: (offset.top + input.outerHeight()) + "px", left: offset.left + "px",
minWidth: input.css("width")
});
render = render || function(idx, value) { return value; }