Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions modules/mixins/animate-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ const currentPositionY = (options) => {

const scrollContainerHeight = (options) => {
const containerElement = options.data.containerElement;
const body = document.body;
const htmlEl = document.documentElement;

if (containerElement && containerElement !== document && containerElement !== document.body) {
return Math.max(
containerElement.scrollHeight,
containerElement.offsetHeight,
containerElement.clientHeight
);
} else {
let body = document.body;
let html = document.documentElement;

return Math.max(
body.scrollHeight,
body.offsetHeight,
html.clientHeight,
html.scrollHeight,
html.offsetHeight
);
}

return Math.max(
body.scrollHeight,
body.offsetHeight,
htmlEl.clientHeight,
htmlEl.scrollHeight,
htmlEl.offsetHeight
);
};

const animateScroll = (easing, options, timestamp) => {
Expand Down Expand Up @@ -210,4 +210,4 @@ export default {
scrollToBottom,
scrollTo,
scrollMore,
};
};