Skip to content

Commit

Permalink
dist files added
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyTB committed Dec 31, 2021
1 parent af9bdb2 commit b587336
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions dist/panzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function createPanZoom(domElement, options) {
var speed = typeof options.zoomSpeed === 'number' ? options.zoomSpeed : defaultZoomSpeed;
var transformOrigin = parseTransformOrigin(options.transformOrigin);
var textSelection = options.enableTextSelection ? fakeTextSelectorInterceptor : domTextSelectionInterceptor;
var panButton = options.panButton || 'left';

validateBounds(bounds);

Expand Down Expand Up @@ -740,11 +741,20 @@ function createPanZoom(domElement, options) {
e.stopPropagation();
return false;
}
// for IE, left click == 1
// for Firefox, left click == 0
var isLeftButton =
(e.button === 1 && window.event !== null) || e.button === 0;
if (!isLeftButton) return;

if (panButton === 'left') {
// for IE, left click == 1
// for Firefox, left click == 0
var isLeftButton =
(e.button === 1 && window.event !== null) || e.button === 0;
if (!isLeftButton) return;
}

if (panButton === 'middle') {
var isMiddleButton =
(e.button === 3 && window.event !== null) || e.button === 1;
if (!isMiddleButton) return;
}

smoothScroll.cancel();

Expand Down
Loading

0 comments on commit b587336

Please sign in to comment.