Rename contextMenuEmulation -> longPress
This commit is contained in:
parent
9783d9ba22
commit
3aeff55f24
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user