aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-10-29 18:55:33 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-10-29 18:55:33 +0530
commit3e7012687b12f3d973169c6d84ca2d57bf79cbd9 (patch)
treedb2fcc2d682e8e3292fd8bdba3515ff549f9204b /src/Utils.ts
parentf717fe11d003fe5fc029c6a90df41208db3ceb54 (diff)
parent74e080fd58c681a549a8e369202096bd456b6e6e (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into restored_server_monitor
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index cc7ee9537..daacca51d 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -475,7 +475,7 @@ const easeInOutQuad = (currentTime: number, start: number, change: number, durat
return (-change / 2) * (newCurrentTime * (newCurrentTime - 2) - 1) + start;
};
-export function smoothScroll(duration: number, element: HTMLElement, to: number) {
+export function smoothScroll(duration: number, element: HTMLElement, to: number, finish?: () => void) {
const start = element.scrollTop;
const change = to - start;
const startDate = new Date().getTime();
@@ -489,6 +489,7 @@ export function smoothScroll(duration: number, element: HTMLElement, to: number)
requestAnimationFrame(animateScroll);
} else {
element.scrollTop = to;
+ finish?.();
}
};
animateScroll();