Skip to content

Commit a7bb1c2

Browse files
committed
Build JS
1 parent 43aad07 commit a7bb1c2

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

inst/htmlwidgets/assets/leaflet.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -593,23 +593,27 @@ function preventUnintendedZoomOnScroll(map) {
593593
});
594594
(0, _jquery2["default"])(document).on("mousemove", "*", function (e) {
595595
// Did the mouse really move?
596-
if (lastScreen.x !== null && e.screenX !== lastScreen.x || e.screenY !== lastScreen.y) {
597-
// It really moved. Enable zooming.
596+
if (map.options.scrollWheelZoom) {
597+
if (lastScreen.x !== null && e.screenX !== lastScreen.x || e.screenY !== lastScreen.y) {
598+
// It really moved. Enable zooming.
599+
map.scrollWheelZoom.enable();
600+
lastScreen = {
601+
x: null,
602+
y: null
603+
};
604+
}
605+
}
606+
});
607+
(0, _jquery2["default"])(document).on("mousedown", ".leaflet", function (e) {
608+
// Clicking always enables zooming.
609+
if (map.options.scrollWheelZoom) {
598610
map.scrollWheelZoom.enable();
599611
lastScreen = {
600612
x: null,
601613
y: null
602614
};
603615
}
604616
});
605-
(0, _jquery2["default"])(document).on("mousedown", ".leaflet", function (e) {
606-
// Clicking always enables zooming.
607-
map.scrollWheelZoom.enable();
608-
lastScreen = {
609-
x: null,
610-
y: null
611-
};
612-
});
613617
}
614618

615619
_htmlwidgets2["default"].widget({

0 commit comments

Comments
 (0)