|
@@ -3,6 +3,7 @@ require('./layout.css')
|
3
|
3
|
require('./range.css')
|
4
|
4
|
|
5
|
5
|
var mapWasDragEnabled
|
|
6
|
+var mapWasTapEnabled
|
6
|
7
|
|
7
|
8
|
// Leaflet v0.7 backwards compatibility
|
8
|
9
|
function on (el, types, fn, context) {
|
|
@@ -24,17 +25,23 @@ function getRangeEvent (rangeInput) {
|
24
|
25
|
|
25
|
26
|
function cancelMapDrag () {
|
26
|
27
|
mapWasDragEnabled = this._map.dragging.enabled()
|
|
28
|
+ mapWasTapEnabled = this._map.tap && this._map.tap.enabled()
|
27
|
29
|
this._map.dragging.disable()
|
|
30
|
+ this._map.tap && this._map.tap.disable()
|
28
|
31
|
}
|
29
|
32
|
|
30
|
33
|
function uncancelMapDrag (e) {
|
31
|
|
- if (!mapWasDragEnabled) return
|
32
|
34
|
this._refocusOnMap(e)
|
33
|
|
- this._map.dragging.enable()
|
|
35
|
+ if (mapWasDragEnabled) {
|
|
36
|
+ this._map.dragging.enable()
|
|
37
|
+ }
|
|
38
|
+ if (mapWasTapEnabled) {
|
|
39
|
+ this._map.tap.enable()
|
|
40
|
+ }
|
34
|
41
|
}
|
35
|
42
|
|
36
|
43
|
// convert arg to an array - returns empty array if arg is undefined
|
37
|
|
-function asArray(arg) {
|
|
44
|
+function asArray (arg) {
|
38
|
45
|
return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
|
39
|
46
|
}
|
40
|
47
|
|