@@ -176,7 +176,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
176
176
/** @internal called when the main page (after successful mousedown) receives a move event to drag the item around the screen */
177
177
protected _mouseMove ( e : DragEvent ) : boolean {
178
178
// console.log(`${count++} move ${e.x},${e.y}`)
179
- let s = this . mouseDownEvent ;
179
+ const s = this . mouseDownEvent ;
180
180
this . lastDrag = e ;
181
181
182
182
if ( this . dragging ) {
@@ -196,7 +196,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
196
196
this . dragging = true ;
197
197
DDManager . dragElement = this ;
198
198
// if we're dragging an actual grid item, set the current drop as the grid (to detect enter/leave)
199
- let grid = this . el . gridstackNode ?. grid ;
199
+ const grid = this . el . gridstackNode ?. grid ;
200
200
if ( grid ) {
201
201
DDManager . dropElement = ( grid . el as DDElementHost ) . ddElement . ddDroppable ;
202
202
} else {
@@ -330,16 +330,16 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
330
330
/** @internal restore back the original style before dragging */
331
331
protected _removeHelperStyle ( ) : DDDraggable {
332
332
this . helper . classList . remove ( 'ui-draggable-dragging' ) ;
333
- let node = ( this . helper as GridItemHTMLElement ) ?. gridstackNode ;
333
+ const node = ( this . helper as GridItemHTMLElement ) ?. gridstackNode ;
334
334
// don't bother restoring styles if we're gonna remove anyway...
335
335
if ( ! node ?. _isAboutToRemove && this . dragElementOriginStyle ) {
336
- let helper = this . helper ;
336
+ const helper = this . helper ;
337
337
// don't animate, otherwise we animate offseted when switching back to 'absolute' from 'fixed'.
338
338
// TODO: this also removes resizing animation which doesn't have this issue, but others.
339
339
// Ideally both would animate ('move' would immediately restore 'absolute' and adjust coordinate to match,
340
340
// then trigger a delay (repaint) to restore to final dest with animate) but then we need to make sure 'resizestop'
341
341
// is called AFTER 'transitionend' event is received (see https://github.com/gridstack/gridstack.js/issues/2033)
342
- let transition = this . dragElementOriginStyle [ 'transition' ] || null ;
342
+ const transition = this . dragElementOriginStyle [ 'transition' ] || null ;
343
343
helper . style . transition = this . dragElementOriginStyle [ 'transition' ] = 'none' ; // can't be NULL #1973
344
344
DDDraggable . originStyleProp . forEach ( prop => helper . style [ prop ] = this . dragElementOriginStyle [ prop ] || null ) ;
345
345
setTimeout ( ( ) => helper . style . transition = transition , 50 ) ; // recover animation from saved vars after a pause (0 isn't enough #1973)
@@ -350,7 +350,7 @@ export class DDDraggable extends DDBaseImplement implements HTMLElementExtendOpt
350
350
351
351
/** @internal updates the top/left position to follow the mouse */
352
352
protected _dragFollow ( e : DragEvent ) : void {
353
- let containmentRect = { left : 0 , top : 0 } ;
353
+ const containmentRect = { left : 0 , top : 0 } ;
354
354
// if (this.helper.style.position === 'absolute') { // we use 'fixed'
355
355
// const { left, top } = this.helperContainment.getBoundingClientRect();
356
356
// containmentRect = { left, top };
0 commit comments