From 76678c5f913952ca107cd5a4c9d42102069925c0 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Jan 2018 18:12:05 -0800 Subject: [PATCH] Fix #5366, #5975, taken from @dannyBies --- src/definitions/modules/dropdown.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 88d1426bad..61d9619eae 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -3216,6 +3216,7 @@ $.fn.dropdown = function(parameters) { ; calculations = { context: { + offset : $context.offset(), scrollTop : $context.scrollTop(), height : $context.outerHeight() }, @@ -3228,8 +3229,8 @@ $.fn.dropdown = function(parameters) { calculations.menu.offset.top += calculations.context.scrollTop; } onScreen = { - above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.menu.height, - below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top + calculations.menu.height + above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.context.offset.top - calculations.menu.height, + below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top - calculations.context.offset.top + calculations.menu.height }; if(onScreen.below) { module.verbose('Dropdown can fit in context downward', onScreen); @@ -3882,4 +3883,4 @@ $.fn.dropdown.settings.templates = { }; -})( jQuery, window, document ); \ No newline at end of file +})( jQuery, window, document );