diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-11-07 22:32:47 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-11-07 22:32:47 +0000 |
commit | 5df9dafae81139b8f67795d1b12e01c26f5dfbfc (patch) | |
tree | 06b4e8c3ee94f5767d93dbf07cb315a0fbfe07ca /misc | |
parent | cfc01f0ae9d1bbbbfaf3e348bfcf16dcd5285a39 (diff) | |
download | brdo-5df9dafae81139b8f67795d1b12e01c26f5dfbfc.tar.gz brdo-5df9dafae81139b8f67795d1b12e01c26f5dfbfc.tar.bz2 |
- Patch #625170 by roborn, stBorchert, casey, sun, amateescu: autocomplete popup position.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/autocomplete.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/misc/autocomplete.js b/misc/autocomplete.js index ffbbe1f00..bb4d599ae 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -172,6 +172,8 @@ Drupal.jsAC.prototype.hidePopup = function (keycode) { * Positions the suggestions popup and starts a search. */ Drupal.jsAC.prototype.populatePopup = function () { + var $input = $(this.input); + var position = $input.position(); // Show popup. if (this.popup) { $(this.popup).remove(); @@ -180,11 +182,12 @@ Drupal.jsAC.prototype.populatePopup = function () { this.popup = $('<div id="autocomplete"></div>')[0]; this.popup.owner = this; $(this.popup).css({ - marginTop: this.input.offsetHeight + 'px', - width: (this.input.offsetWidth - 4) + 'px', + top: parseInt(position.top + this.input.offsetHeight, 10) + 'px', + left: parseInt(position.left, 10) + 'px', + width: $input.innerWidth() + 'px', display: 'none' }); - $(this.input).before(this.popup); + $input.before(this.popup); // Do search. this.db.owner = this; |