From 5a8e0f2048d6b2ef1d271fc8ca05c6d5bd338aed Mon Sep 17 00:00:00 2001
From: Thomas Tanghus <thomas@tanghus.net>
Date: Sat, 16 Feb 2013 19:56:56 +0100
Subject: [PATCH] Extra position check for multiselect dropdown. Fix
 app/issues/575

---
 core/js/multiselect.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/js/multiselect.js b/core/js/multiselect.js
index 623c6e0f7e..bc4223feb6 100644
--- a/core/js/multiselect.js
+++ b/core/js/multiselect.js
@@ -266,8 +266,9 @@
 			}
 			list.append(list.find('li.creator'));
 			var pos=button.position();
-			if($(document).height() > (button.offset().top+button.outerHeight() + list.children().length * button.height())
-				|| $(document).height()/2 > pos.top
+			if(($(document).height() > (button.offset().top+button.outerHeight() + list.children().length * button.height())
+				&& $(document).height() - button.offset().top > (button.offset().top+button.outerHeight() + list.children().length * button.height()))
+				|| $(document).height()/2 > button.offset().top
 			) {
 				list.css({
 					top:pos.top+button.outerHeight()-5,
-- 
GitLab