File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 29
29
var dir_map = { x : 'left' , y : 'top' } ;
30
30
var isTouch = ! ! ( 'ontouchstart' in window ) ;
31
31
var pointer_events = {
32
- start : isTouch ? 'touchstart.gridster-draggable' : ' mousedown.gridster-draggable',
33
- move : isTouch ? 'touchmove.gridster-draggable' : ' mousemove.gridster-draggable',
34
- end : isTouch ? 'touchend.gridster-draggable' : ' mouseup.gridster-draggable'
32
+ start : 'touchstart.gridster-draggable mousedown.gridster-draggable' ,
33
+ move : 'touchmove.gridster-draggable mousemove.gridster-draggable' ,
34
+ end : 'touchend.gridster-draggable mouseup.gridster-draggable'
35
35
} ;
36
36
37
37
var capitalize = function ( str ) {
111
111
112
112
113
113
fn . get_mouse_pos = function ( e ) {
114
- if ( isTouch ) {
114
+ if ( e . originalEvent && e . originalEvent . touches ) {
115
115
var oe = e . originalEvent ;
116
116
e = oe . touches . length ? oe . touches [ 0 ] : oe . changedTouches [ 0 ] ;
117
117
}
235
235
236
236
fn . drag_handler = function ( e ) {
237
237
var node = e . target . nodeName ;
238
+ // skip if drag is disabled, or click was not done with the mouse primary button
238
239
if ( this . disabled || e . which !== 1 && ! isTouch ) {
239
240
return ;
240
241
}
You can’t perform that action at this time.
0 commit comments