Skip to content

Commit 00041e9

Browse files
Fix to not call mediumZoom if the page does not move.
1 parent aaa9539 commit 00041e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/zoom.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ export default (function () {
3333

3434

3535
return {
36-
onRouteUpdate({ location }) {
37-
36+
onRouteUpdate({ location , previousLocation}) {
3837
if( location && location.hash && location.hash.length ) {
3938
return;
4039
}
4140

41+
if (!previousLocation || location.pathname === previousLocation.pathname) {
42+
return;
43+
}
44+
4245
setTimeout(() => {
4346
mediumZoom(selector, options);
4447
}, 1000);

0 commit comments

Comments
 (0)