Fix: keep context menu contained in browser window

This commit is contained in:
Eric Schultz
2015-11-25 22:33:37 -06:00
parent 15d0e51e22
commit bd2f9bfe2c

View File

@@ -133,7 +133,7 @@ var context = context || (function () {
if (typeof options.above == 'boolean') {
place_above = options.above;
} else if (typeof options.above == 'string' && options.above == 'auto') {
place_above = ((e.pageY + $dd.height() + 32) > $(document).height());
place_above = ((e.pageY + $dd.height() + 32) > $(window).height() + $(document).scrollTop());
}
if (place_above) {