File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2929 var dir_map = { x : 'left' , y : 'top' } ;
3030 var isTouch = ! ! ( 'ontouchstart' in window ) ;
3131 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'
3535 } ;
3636
3737 var capitalize = function ( str ) {
111111
112112
113113 fn . get_mouse_pos = function ( e ) {
114- if ( isTouch ) {
114+ if ( e . originalEvent && e . originalEvent . touches ) {
115115 var oe = e . originalEvent ;
116116 e = oe . touches . length ? oe . touches [ 0 ] : oe . changedTouches [ 0 ] ;
117117 }
235235
236236 fn . drag_handler = function ( e ) {
237237 var node = e . target . nodeName ;
238+ // skip if drag is disabled, or click was not done with the mouse primary button
238239 if ( this . disabled || e . which !== 1 && ! isTouch ) {
239240 return ;
240241 }
You can’t perform that action at this time.
0 commit comments