-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
preventDefaultAction in canvas-drag on minimap #1484
preventDefaultAction in canvas-drag on minimap #1484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great; glad to have this! Just a couple comments on the docs.
src/navigator.js
Outdated
/** | ||
* Raised when a click event occurs on the {@link OpenSeadragon.Viewer#navigator} element. | ||
* | ||
* @event navigator-click |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be navigator-drag
.
src/navigator.js
Outdated
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised this event. | ||
* @property {OpenSeadragon.MouseTracker} tracker - A reference to the MouseTracker which originated this event. | ||
* @property {OpenSeadragon.Point} position - The position of the event relative to the tracked element. | ||
* @property {Boolean} quick - True only if the clickDistThreshold and clickTimeThreshold are both passed. Useful for differentiating between clicks and drags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is left over from the click handler. We don't need quick
but it looks like we need delta
, speed
, and direction
. You can copy their text from the viewer's canvas-drag
event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Copy and paste without double-checking... :/
Locally tested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful, thank you!
To integrate #1416, 'navigator-drag' event has been added together with the preventDefaultaction support.
To block mouse drag interactions: