mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Interaction: Ignore MSPointer events if they're initiated from a mouse, but not from the primary button.
This commit is contained in:
parent
d6c3360dec
commit
3077b608c8
10
ui/jquery.ui.interaction.js
vendored
10
ui/jquery.ui.interaction.js
vendored
@ -160,8 +160,6 @@ var touchHook = interaction.hooks.touch = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: test mouse
|
|
||||||
// TODO: how can we detect a "right click" with a pen?
|
|
||||||
var pointerHook = interaction.hooks.msPointer = {
|
var pointerHook = interaction.hooks.msPointer = {
|
||||||
setup: function( widget, start ) {
|
setup: function( widget, start ) {
|
||||||
widget._bind({
|
widget._bind({
|
||||||
@ -172,6 +170,14 @@ var pointerHook = interaction.hooks.msPointer = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: how can we detect a "right click" with a pen?
|
||||||
|
// TODO: get full details about which and button from MS
|
||||||
|
// touch and pen = 1
|
||||||
|
// primary mouse button = 2
|
||||||
|
if ( event.which > 2 ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// track which pointer is performing the interaction
|
// track which pointer is performing the interaction
|
||||||
pointerHook.id = event.pointerId;
|
pointerHook.id = event.pointerId;
|
||||||
// prevent panning/zooming
|
// prevent panning/zooming
|
||||||
|
Loading…
Reference in New Issue
Block a user