import popper.js
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
615dc56d16
commit
16fb2bb919
241 changed files with 34099 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
export default function simulateScroll(
|
||||
element,
|
||||
{ scrollTop, scrollLeft, delay }
|
||||
) {
|
||||
const scrollingElement = element === document.body
|
||||
? document.scrollingElement || document.documentElement
|
||||
: element;
|
||||
|
||||
const applyScroll = () => {
|
||||
if (scrollTop !== undefined) {
|
||||
scrollingElement.scrollTop = scrollTop;
|
||||
}
|
||||
if (scrollLeft !== undefined) {
|
||||
scrollingElement.scrollLeft = scrollLeft;
|
||||
}
|
||||
};
|
||||
|
||||
if (delay !== undefined) {
|
||||
setTimeout(applyScroll, delay);
|
||||
} else {
|
||||
applyScroll();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue