Skip to content

Commit

Permalink
- Fixed bug: Scroll overflow and the padding-top #3609
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarotrigo committed Jun 28, 2019
1 parent 2f8df06 commit bd8a2d5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vendors/scrolloverflow.js
Expand Up @@ -2261,19 +2261,21 @@ if ( typeof module != 'undefined' && module.exports ) {
contentHeight = scrollOverflowHandler.scrollHeight(element);
}
else{
contentHeight = element.scrollHeight - paddings;
contentHeight = element.scrollHeight;
if(self.options.verticalCentered){
contentHeight = $(TABLE_CELL_SEL, element)[0].scrollHeight + paddings;
contentHeight = $(TABLE_CELL_SEL, element)[0].scrollHeight;
}
}

var scrollHeight = fp_utils.getWindowHeight() - paddings;

var scrollHeight = fp_utils.getWindowHeight();
var contentHeightWidthPaddings = contentHeight + paddings;
var scrollHeightWidthoutPaddings = scrollHeight - paddings;

//needs scroll?
if ( contentHeight > scrollHeight) {
if ( contentHeightWidthPaddings > scrollHeight) {
//did we already have an scrollbar ? Updating it
if(scrollable != null){
scrollOverflowHandler.update(element, scrollHeight);
scrollOverflowHandler.update(element, scrollHeightWidthoutPaddings);
}
//creating the scrolling
else{
Expand All @@ -2284,7 +2286,7 @@ if ( typeof module != 'undefined' && module.exports ) {
fp_utils.wrapInner(element, wrap.scroller);
fp_utils.wrapInner(element, wrap.scrollable);
}
scrollOverflowHandler.create(element, scrollHeight, self.iscrollOptions);
scrollOverflowHandler.create(element, scrollHeightWidthoutPaddings, self.iscrollOptions);
}
}

Expand Down

0 comments on commit bd8a2d5

Please sign in to comment.