Skip to content

Commit

Permalink
Fix #5366, #5975, taken from @dannyBies
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jan 29, 2018
1 parent e888a26 commit 76678c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3216,6 +3216,7 @@ $.fn.dropdown = function(parameters) {
;
calculations = {
context: {
offset : $context.offset(),
scrollTop : $context.scrollTop(),
height : $context.outerHeight()
},
Expand All @@ -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);
Expand Down Expand Up @@ -3882,4 +3883,4 @@ $.fn.dropdown.settings.templates = {

};

})( jQuery, window, document );
})( jQuery, window, document );

0 comments on commit 76678c5

Please sign in to comment.