Skip to content

Commit 568289b

Browse files
committed
Interaction: Add pointercancel
1 parent 411153f commit 568289b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ui/jquery.ui.interaction.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ pointerHook = interaction.hooks.pointer = {
119119
},
120120

121121
handle: function( widget, move, stop ) {
122-
function pointermove( event ) {
122+
function moveHandler( event ) {
123123
event = event.originalEvent;
124124
move( event, {
125125
x: event.pageX,
126126
y: event.pageY
127127
});
128128
}
129129

130-
function pointerup( event ) {
130+
function stopHandler( event ) {
131131
event = event.originalEvent;
132132

133133
// Only stop if original pointer stops
@@ -143,13 +143,15 @@ pointerHook = interaction.hooks.pointer = {
143143
pointerHook.id = null;
144144

145145
widget.document
146-
.unbind( "pointermove", pointermove )
147-
.unbind( "pointerup", pointerup );
146+
.unbind( "pointermove", moveHandler )
147+
.unbind( "pointerup", stopHandler )
148+
.unbind( "pointercancel", stopHandler );
148149
}
149150

150151
widget._on( widget.document, {
151-
"pointermove": pointermove,
152-
"pointerup": pointerup
152+
"pointermove": moveHandler,
153+
"pointerup": stopHandler,
154+
"pointercancel": stopHandler
153155
});
154156
}
155157
};

0 commit comments

Comments
 (0)