From 3ed2cc091ac473c8610c41e5b9941939007f1e02 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 16 Jul 2012 19:38:02 +0300 Subject: [PATCH] fixed dropdown alignment in firefox. still need to test IE. #214 --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index ed1683e7..4ebd445a 100755 --- a/select2.js +++ b/select2.js @@ -717,7 +717,7 @@ height = this.container.outerHeight(), width = this.container.outerWidth(), dropHeight = this.dropdown.outerHeight(), - viewportBottom = document.body.scrollTop + document.documentElement.clientHeight, + viewportBottom = $(window).scrollTop() + document.documentElement.clientHeight, dropTop = offset.top + height, enoughRoomBelow = dropTop + dropHeight <= viewportBottom, enoughRoomAbove = (offset.top - dropHeight) >= document.body.scrollTop,