File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 247247 this . $document = $ ( itemContainer . el [ 0 ] . ownerDocument )
248248
249249 // get item to drag
250- this . item = $ ( e . target ) . closest ( this . options . itemSelector )
251- this . itemContainer = itemContainer
252-
253- if ( this . item . is ( this . options . exclude ) ||
254- ! this . options . onMousedown ( this . item , groupDefaults . onMousedown , e ) ) {
255- return
250+ var closestItem = $ ( e . target ) . closest ( this . options . itemSelector ) ;
251+ // using the length of this item, prevents the plugin from being started if there is no handle being clicked on.
252+ // this may also be helpful in instantiating multidrag.
253+ if ( closestItem . length ) {
254+ this . item = closestItem ;
255+ this . itemContainer = itemContainer ;
256+ if ( this . item . is ( this . options . exclude ) || ! this . options . onMousedown ( this . item , groupDefaults . onMousedown , e ) ) {
257+ return ;
258+ }
259+ this . setPointer ( e ) ;
260+ this . toggleListeners ( 'on' ) ;
261+ this . setupDelayTimer ( ) ;
262+ this . dragInitDone = true ;
256263 }
257-
258- this . setPointer ( e )
259- this . toggleListeners ( 'on' )
260-
261- this . setupDelayTimer ( )
262- this . dragInitDone = true
263264 } ,
264265 drag : function ( e ) {
265266 if ( ! this . dragging ) {
You can’t perform that action at this time.
0 commit comments