multiSelect: Don't force popup above if there's no room for it there.

This commit is contained in:
Thomas Tanghus 2012-12-21 00:53:23 +01:00
parent 73b186cc60
commit 63fa943a52
1 changed files with 3 additions and 1 deletions

View File

@ -238,7 +238,9 @@
list.append(li);
}
var pos=button.position();
if($(document).height() > button.offset().top+button.outerHeight() + list.children().length * button.height()) {
if($(document).height() > (button.offset().top+button.outerHeight() + list.children().length * button.height())
|| $(document).height()/2 > pos.top
) {
list.css('top',pos.top+button.outerHeight()-5);
list.css('left',pos.left+3);
list.css('width',(button.outerWidth()-2)+'px');