From 9a767782db4ba183dddf03567a1f05ce170d094b Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Thu, 22 Jan 2009 13:18:58 +0000 Subject: 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 --- share/www/script/jquery.suggest.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'share') 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 = $('') - .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; } -- cgit v1.2.3