Skip to content

Commit b587336

Browse files
committed
dist files added
1 parent af9bdb2 commit b587336

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

dist/panzoom.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function createPanZoom(domElement, options) {
7070
var speed = typeof options.zoomSpeed === 'number' ? options.zoomSpeed : defaultZoomSpeed;
7171
var transformOrigin = parseTransformOrigin(options.transformOrigin);
7272
var textSelection = options.enableTextSelection ? fakeTextSelectorInterceptor : domTextSelectionInterceptor;
73+
var panButton = options.panButton || 'left';
7374

7475
validateBounds(bounds);
7576

@@ -740,11 +741,20 @@ function createPanZoom(domElement, options) {
740741
e.stopPropagation();
741742
return false;
742743
}
743-
// for IE, left click == 1
744-
// for Firefox, left click == 0
745-
var isLeftButton =
746-
(e.button === 1 && window.event !== null) || e.button === 0;
747-
if (!isLeftButton) return;
744+
745+
if (panButton === 'left') {
746+
// for IE, left click == 1
747+
// for Firefox, left click == 0
748+
var isLeftButton =
749+
(e.button === 1 && window.event !== null) || e.button === 0;
750+
if (!isLeftButton) return;
751+
}
752+
753+
if (panButton === 'middle') {
754+
var isMiddleButton =
755+
(e.button === 3 && window.event !== null) || e.button === 1;
756+
if (!isMiddleButton) return;
757+
}
748758

749759
smoothScroll.cancel();
750760

0 commit comments

Comments
 (0)