Rename contextMenuEmulation -> longPress

This commit is contained in:
danzel 2012-10-31 13:05:38 +13:00
parent 9783d9ba22
commit 3aeff55f24
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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,