@@ -114,10 +114,10 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
114114 }
115115
116116 // re-use the existing node dragging method
117- this . _onStartMoving ( event , ui , node , cellWidth , cellHeight ) ;
117+ this . _onStartMoving ( helper , event , ui , node , cellWidth , cellHeight ) ;
118118 } else {
119119 // re-use the existing node dragging that does so much of the collision detection
120- this . _dragOrResize ( event , ui , node , cellWidth , cellHeight ) ;
120+ this . _dragOrResize ( helper , event , ui , node , cellWidth , cellHeight ) ;
121121 }
122122 }
123123
@@ -387,12 +387,12 @@ GridStack.prototype._prepareDragDropByNode = function(node: GridStackNode): Grid
387387 cellWidth = this . cellWidth ( ) ;
388388 cellHeight = this . getCellHeight ( true ) ; // force pixels for calculations
389389
390- this . _onStartMoving ( event , ui , node , cellWidth , cellHeight ) ;
390+ this . _onStartMoving ( el , event , ui , node , cellWidth , cellHeight ) ;
391391 }
392392
393393 /** called when item is being dragged/resized */
394394 let dragOrResize = ( event : Event , ui : DDUIData ) => {
395- this . _dragOrResize ( event , ui , node , cellWidth , cellHeight ) ;
395+ this . _dragOrResize ( el , event , ui , node , cellWidth , cellHeight ) ;
396396 }
397397
398398 /** called when the item stops moving/resizing */
@@ -466,7 +466,7 @@ GridStack.prototype._prepareDragDropByNode = function(node: GridStackNode): Grid
466466}
467467
468468/** @internal called when item is starting a drag/resize */
469- GridStack . prototype . _onStartMoving = function ( event : Event , ui : DDUIData , node : GridStackNode , cellWidth : number , cellHeight : number ) {
469+ GridStack . prototype . _onStartMoving = function ( el : GridItemHTMLElement , event : Event , ui : DDUIData , node : GridStackNode , cellWidth : number , cellHeight : number ) {
470470 this . engine . cleanNodes ( )
471471 . beginUpdate ( node ) ;
472472
@@ -490,7 +490,6 @@ GridStack.prototype._onStartMoving = function(event: Event, ui: DDUIData, node:
490490 // set the min/max resize info
491491 this . engine . cacheRects ( cellWidth , cellHeight , this . opts . marginTop , this . opts . marginRight , this . opts . marginBottom , this . opts . marginLeft ) ;
492492 if ( event . type === 'resizestart' ) {
493- let el = node . el ;
494493 let dd = GridStackDD . get ( )
495494 . resizable ( el , 'option' , 'minWidth' , cellWidth * ( node . minW || 1 ) )
496495 . resizable ( el , 'option' , 'minHeight' , cellHeight * ( node . minH || 1 ) ) ;
@@ -533,8 +532,7 @@ GridStack.prototype._leave = function(node: GridStackNode, el: GridItemHTMLEleme
533532}
534533
535534/** @internal called when item is being dragged/resized */
536- GridStack . prototype . _dragOrResize = function ( event : Event , ui : DDUIData , node : GridStackNode , cellWidth : number , cellHeight : number ) {
537- let el = node . el || event . target as GridItemHTMLElement ;
535+ GridStack . prototype . _dragOrResize = function ( el : GridItemHTMLElement , event : Event , ui : DDUIData , node : GridStackNode , cellWidth : number , cellHeight : number ) {
538536 // calculate the place where we're landing by offsetting margin so actual edge crosses mid point
539537 let left = ui . position . left + ( ui . position . left > node . _lastUiPosition . left ? - this . opts . marginRight : this . opts . marginLeft ) ;
540538 let top = ui . position . top + ( ui . position . top > node . _lastUiPosition . top ? - this . opts . marginBottom : this . opts . marginTop ) ;
0 commit comments