From a6eae4432f35229389ac8f16a9545bd1bb40ce20 Mon Sep 17 00:00:00 2001 From: Poisbeau Mathieu Date: Sat, 7 Sep 2013 12:52:53 +0200 Subject: [PATCH] L.Control.Zoomslider.js : update _onSliderClick() function Best use of L.DomEvent.getMousePosition() function. --- src/L.Control.Zoomslider.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/L.Control.Zoomslider.js b/src/L.Control.Zoomslider.js index 557a0f3..004f0fb 100644 --- a/src/L.Control.Zoomslider.js +++ b/src/L.Control.Zoomslider.js @@ -133,8 +133,7 @@ L.Control.Zoomslider = (function () { _onSliderClick: function (e) { var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e), - y = L.DomEvent.getMousePosition(first).y - - L.DomUtil.getViewportOffset(this._ui.body).y; // Cache this? + y = L.DomEvent.getMousePosition(first, this._ui.body).y; this._knob.setPosition(y); this._updateMapZoom();