Skip to content

Commit a5540e6

Browse files
committed
fix: fix clip issues #10
1 parent 674c737 commit a5540e6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@ L.Control.SplitMap = L.Control.extend({
156156
map.on('move', this._updateClip, this)
157157
map.on('layeradd layerremove', this._updateLayers, this)
158158
on(range, getRangeEvent(range), this._updateClip, this)
159-
on(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
160-
on(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
159+
on(range, 'ontouchstart' in window ? 'touchstart' : 'mousedown', cancelMapDrag, this)
160+
on(range, 'ontouchend' in window ? 'touchend' : 'mouseup', uncancelMapDrag, this)
161161
},
162162

163163
_removeEvents: function () {
164164
var range = this._range
165165
var map = this._map
166166
if (range) {
167167
off(range, getRangeEvent(range), this._updateClip, this)
168-
off(range, L.Browser.touch ? 'touchstart' : 'mousedown', cancelMapDrag, this)
169-
off(range, L.Browser.touch ? 'touchend' : 'mouseup', uncancelMapDrag, this)
168+
off(range, 'ontouchstart' in window ? 'touchstart' : 'mousedown', cancelMapDrag, this)
169+
off(range, 'ontouchend' in window ? 'touchend' : 'mouseup', uncancelMapDrag, this)
170170
}
171171
if (map) {
172172
map.off('layeradd layerremove', this._updateLayers, this)

0 commit comments

Comments
 (0)