@@ -114,10 +114,10 @@ GridStack.prototype._setupAcceptWidget = function(): GridStack {
114
114
}
115
115
116
116
// re-use the existing node dragging method
117
- this . _onStartMoving ( event , ui , node , cellWidth , cellHeight ) ;
117
+ this . _onStartMoving ( helper , event , ui , node , cellWidth , cellHeight ) ;
118
118
} else {
119
119
// 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 ) ;
121
121
}
122
122
}
123
123
@@ -387,12 +387,12 @@ GridStack.prototype._prepareDragDropByNode = function(node: GridStackNode): Grid
387
387
cellWidth = this . cellWidth ( ) ;
388
388
cellHeight = this . getCellHeight ( true ) ; // force pixels for calculations
389
389
390
- this . _onStartMoving ( event , ui , node , cellWidth , cellHeight ) ;
390
+ this . _onStartMoving ( el , event , ui , node , cellWidth , cellHeight ) ;
391
391
}
392
392
393
393
/** called when item is being dragged/resized */
394
394
let dragOrResize = ( event : Event , ui : DDUIData ) => {
395
- this . _dragOrResize ( event , ui , node , cellWidth , cellHeight ) ;
395
+ this . _dragOrResize ( el , event , ui , node , cellWidth , cellHeight ) ;
396
396
}
397
397
398
398
/** called when the item stops moving/resizing */
@@ -466,7 +466,7 @@ GridStack.prototype._prepareDragDropByNode = function(node: GridStackNode): Grid
466
466
}
467
467
468
468
/** @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 ) {
470
470
this . engine . cleanNodes ( )
471
471
. beginUpdate ( node ) ;
472
472
@@ -490,7 +490,6 @@ GridStack.prototype._onStartMoving = function(event: Event, ui: DDUIData, node:
490
490
// set the min/max resize info
491
491
this . engine . cacheRects ( cellWidth , cellHeight , this . opts . marginTop , this . opts . marginRight , this . opts . marginBottom , this . opts . marginLeft ) ;
492
492
if ( event . type === 'resizestart' ) {
493
- let el = node . el ;
494
493
let dd = GridStackDD . get ( )
495
494
. resizable ( el , 'option' , 'minWidth' , cellWidth * ( node . minW || 1 ) )
496
495
. resizable ( el , 'option' , 'minHeight' , cellHeight * ( node . minH || 1 ) ) ;
@@ -533,8 +532,7 @@ GridStack.prototype._leave = function(node: GridStackNode, el: GridItemHTMLEleme
533
532
}
534
533
535
534
/** @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 ) {
538
536
// calculate the place where we're landing by offsetting margin so actual edge crosses mid point
539
537
let left = ui . position . left + ( ui . position . left > node . _lastUiPosition . left ? - this . opts . marginRight : this . opts . marginLeft ) ;
540
538
let top = ui . position . top + ( ui . position . top > node . _lastUiPosition . top ? - this . opts . marginBottom : this . opts . marginTop ) ;
0 commit comments