Make sure popups are on-screen

This commit is contained in:
Guangcong Luo
2015-06-30 02:05:41 -05:00
parent d41b7329b3
commit df1ec9ff3c

View File

@@ -2041,7 +2041,7 @@
(offset.top + sourceHeight < room * 2/3 || offset.top + sourceHeight + 200 < room)) {
$el.css('top', offset.top + sourceHeight);
} else if (height + 5 <= offset.top) {
$el.css('bottom', room - offset.top);
$el.css('bottom', Math.max(room - offset.top, 0));
} else if (height + 10 < room) {
$el.css('bottom', 5);
} else {