From 3aeff55f24480e0bab251533c2d9706234ef16d8 Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 31 Oct 2012 13:05:38 +1300 Subject: [PATCH] Rename contextMenuEmulation -> longPress --- src/dom/Draggable.js | 6 +++--- src/map/handler/Map.Drag.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index 9dd6d0a2..5e5fc671 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -12,10 +12,10 @@ L.Draggable = L.Class.extend({ TAP_TOLERANCE: 15 }, - initialize: function (element, dragStartTarget, contextMenuEmulation) { + initialize: function (element, dragStartTarget, longPress) { this._element = element; this._dragStartTarget = dragStartTarget || element; - this._contextMenuEmulation = contextMenuEmulation; + this._longPress = longPress; }, enable: function () { @@ -68,7 +68,7 @@ L.Draggable = L.Class.extend({ this._startPos = this._newPos = L.DomUtil.getPosition(this._element); //Touch contextmenu event emulation - if (e.touches && e.touches.length === 1 && L.Browser.touch && this._contextMenuEmulation) { + if (e.touches && e.touches.length === 1 && L.Browser.touch && this._longPress) { var self = this; this._contextMenuTimeout = setTimeout(function () { var dist = (self._newPos && self._newPos.distanceTo(self._startPos)) || 0; diff --git a/src/map/handler/Map.Drag.js b/src/map/handler/Map.Drag.js index 15cd4cac..a97c20a8 100644 --- a/src/map/handler/Map.Drag.js +++ b/src/map/handler/Map.Drag.js @@ -10,7 +10,7 @@ L.Map.mergeOptions({ inertiaMaxSpeed: 6000, // px/s inertiaThreshold: L.Browser.touch ? 32 : 18, // ms - touchContextMenuEmulation: true, + longPress: true, // TODO refactor, move to CRS worldCopyJump: true @@ -21,7 +21,7 @@ L.Map.Drag = L.Handler.extend({ if (!this._draggable) { var options = this._map.options; - this._draggable = new L.Draggable(this._map._mapPane, this._map._container, options.touchContextMenuEmulation); + this._draggable = new L.Draggable(this._map._mapPane, this._map._container, options.longPress); this._draggable.on({ 'dragstart': this._onDragStart,