From bbcf9d8b9621091f1efb4a153cb4dce4c51a982e Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 17 Jul 2023 12:33:35 +0200 Subject: [PATCH] Switch from mousewheel to wheel, as Leaflet did Otherwise, wheel will zoom the map even when sent on a panel or control. --- umap/static/umap/js/umap.controls.js | 2 +- umap/static/umap/js/umap.ui.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 82f3863a..517a70f3 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -472,7 +472,7 @@ L.U.DataLayersControl = L.Control.extend({ if (L.Browser.pointer) { L.DomEvent.disableClickPropagation(container) - L.DomEvent.on(container, 'mousewheel', L.DomEvent.stopPropagation) + L.DomEvent.on(container, 'wheel', L.DomEvent.stopPropagation) L.DomEvent.on(container, 'MozMousePixelScroll', L.DomEvent.stopPropagation) } if (!L.Browser.touch) { diff --git a/umap/static/umap/js/umap.ui.js b/umap/static/umap/js/umap.ui.js index 6a87f193..6485dc23 100644 --- a/umap/static/umap/js/umap.ui.js +++ b/umap/static/umap/js/umap.ui.js @@ -11,7 +11,7 @@ L.U.UI = L.Evented.extend({ this.container = L.DomUtil.create('div', 'leaflet-ui-container', this.parent) L.DomEvent.disableClickPropagation(this.container) L.DomEvent.on(this.container, 'contextmenu', L.DomEvent.stopPropagation) // Do not activate our custom context menu. - L.DomEvent.on(this.container, 'mousewheel', L.DomEvent.stopPropagation) + L.DomEvent.on(this.container, 'wheel', L.DomEvent.stopPropagation) L.DomEvent.on(this.container, 'MozMousePixelScroll', L.DomEvent.stopPropagation) this._panel = L.DomUtil.create('div', '', this.container) this._panel.id = 'umap-ui-container'