Skip to content
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

Merged
merged 3 commits into from
Jun 29, 2018

Conversation

francescocretti
Copy link
Contributor

To integrate #1416, 'navigator-drag' event has been added together with the preventDefaultaction support.

To block mouse drag interactions:

viewer.addHandler('navigator-drag', function (e) {
     e.preventDefaultAction=true;
} )

Copy link
Member

@iangilman iangilman left a 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
Copy link
Member

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.
Copy link
Member

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.

Copy link
Contributor Author

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... :/

@francescocretti
Copy link
Contributor Author

francescocretti commented Jun 26, 2018

Locally tested:

>> 223 tests completed with 0 failed, 0 skipped, and 0 todo. 
>> 2051 assertions (in 44877ms), passed: 2051, failed: 0

Done.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, thank you!

@iangilman iangilman merged commit 7b73768 into openseadragon:master Jun 29, 2018
iangilman added a commit that referenced this pull request Jun 29, 2018
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.

2 participants