From 1daf24aae130eaad8bec4cd23ee0548528586ff5 Mon Sep 17 00:00:00 2001 From: martinlechner1 Date: Thu, 13 Feb 2014 12:11:05 +0100 Subject: [PATCH] Fixed a bug introduced in refactoring --- src/jquery.autocomplete.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 5f7db57..af3b920 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -258,12 +258,12 @@ offset = that.el.offset(); styles = { - top: (offset.top + that.el.outerHeight()) + 'px', left: offset.left + 'px' }; - - if(!!that.options.openOnTop){ - styles.top = $(document).height() - offset.top + 'px'; + if(!that.options.openOnTop){ + styles.top = (offset.top + that.el.outerHeight()) + 'px' + }else{ + styles.bottom = ($(document).height() - offset.top) + 'px'; } if (that.options.width === 'auto') {