From a5540e6de78a9fb3f2d3b45128471f5a19de6c65 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Thu, 7 Sep 2023 13:01:21 +0200 Subject: [PATCH] fix: fix clip issues #10 --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 5603722..f3d6acd 100644 --- a/src/index.js +++ b/src/index.js @@ -156,8 +156,8 @@ L.Control.SplitMap = L.Control.extend({ map.on('move', this._updateClip, this) map.on('layeradd layerremove', this._updateLayers, this) on(range, getRangeEvent(range), this._updateClip, this) - on(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this) - on(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this) + on(range, 'ontouchstart' in window ? 'touchstart' : 'mousedown', cancelMapDrag, this) + on(range, 'ontouchend' in window ? 'touchend' : 'mouseup', uncancelMapDrag, this) }, _removeEvents: function () { @@ -165,8 +165,8 @@ L.Control.SplitMap = L.Control.extend({ var map = this._map if (range) { off(range, getRangeEvent(range), this._updateClip, this) - off(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this) - off(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this) + off(range, 'ontouchstart' in window ? 'touchstart' : 'mousedown', cancelMapDrag, this) + off(range, 'ontouchend' in window ? 'touchend' : 'mouseup', uncancelMapDrag, this) } if (map) { map.off('layeradd layerremove', this._updateLayers, this)