e.button === 0 is the left mouse button.

This commit is contained in:
Szunti 2015-03-06 20:25:04 +01:00
parent bba39b3eba
commit 0d1716d796
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ L.Draggable = L.Evented.extend({
_onDown: function (e) {
this._moved = false;
if (e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
if (e.shiftKey || ((e.which !== 1) && (e.button !== 0) && !e.touches)) { return; }
L.DomEvent.stopPropagation(e);

View File

@ -27,7 +27,7 @@ L.Map.BoxZoom = L.Handler.extend({
},
_onMouseDown: function (e) {
if (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; }
if (!e.shiftKey || ((e.which !== 1) && (e.button !== 0))) { return false; }
this._moved = false;
@ -83,7 +83,7 @@ L.Map.BoxZoom = L.Handler.extend({
},
_onMouseUp: function (e) {
if ((e.which !== 1) && (e.button !== 1)) { return; }
if ((e.which !== 1) && (e.button !== 0)) { return; }
this._finish();