Skip to content

Added option to filter mousedown #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2019
Merged

Added option to filter mousedown #141

merged 2 commits into from
Nov 23, 2019

Conversation

EduardoRG
Copy link

@EduardoRG EduardoRG commented Nov 9, 2019

I wanted to disable panning unless altKey is pressed. The proposal allows to disable totally the mousedown panning or filtering by key. I think it's related to #72, #90 and maybe #133. Added beforeMouseDown() option to docs.

E.g.

panzoom(element, {
  beforeMouseDown: function(e) {
    // allow mouse-down panning only if altKey is down. Otherwise - ignore
    var shouldIgnore = !e.altKey;
    return shouldIgnore;
  }
});

@992forever
Copy link

Hello, I also need to disable panning in my project. Why didn't I find the "beforeMouseDown" property method in version 8.6.1? Looking forward for your response, thank you

@anvaka anvaka merged commit 5f5fb54 into anvaka:master Nov 23, 2019
@anvaka
Copy link
Owner

anvaka commented Nov 23, 2019

Thank you, published as 8.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants