Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 55afb50

Browse filesBrowse files
committed
fix: only call onDone if it's defined
1 parent 0c0a297 commit 55afb50
Copy full SHA for 55afb50

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎src/scrollTo.js

Copy file name to clipboardExpand all lines: src/scrollTo.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export const scroller = () => {
162162
x = options.x === undefined ? defaults.x : options.x;
163163
y = options.y === undefined ? defaults.y : options.y;
164164

165-
var cumulativeOffsetContainer = _.cumulativeOffset(container);
166-
var cumulativeOffsetElement = _.cumulativeOffset(element);
165+
let cumulativeOffsetContainer = _.cumulativeOffset(container);
166+
let cumulativeOffsetElement = _.cumulativeOffset(element);
167167

168168
if (typeof offset === "function") {
169169
offset = offset(element, container);
@@ -212,7 +212,7 @@ export const scroller = () => {
212212
if (onStart) onStart(element);
213213

214214
if (!diffY && !diffX) {
215-
onDone(element);
215+
if (onDone) onDone(element);
216216
return;
217217
}
218218

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.