|
6 | 6 | /* eslint-disable @typescript-eslint/no-unused-vars */ |
7 | 7 | import { GridStackDDI } from './gridstack-ddi'; |
8 | 8 | import { GridItemHTMLElement, GridStackNode, GridStackElement, DDUIData, DDDragInOpt, GridStackPosition } from './types'; |
9 | | -import { GridStack, MousePosition } from './gridstack'; |
| 9 | +import { GridStack } from './gridstack'; |
10 | 10 | import { Utils } from './utils'; |
11 | 11 |
|
12 | 12 | /** Drag&Drop drop options */ |
@@ -273,7 +273,7 @@ GridStack.prototype._setupAcceptWidget = function(this: GridStack): GridStack { |
273 | 273 | Utils.copyPos(node, this._readAttr(this.placeholder)); // placeholder values as moving VERY fast can throw things off #1578 |
274 | 274 | Utils.removePositioningStyles(el);// @ts-ignore |
275 | 275 | this._writeAttr(el, node); |
276 | | - this.el.appendChild(el);// @ts-ignore |
| 276 | + this.el.appendChild(el);// @ts-ignore // TODO: now would be ideal time to _removeHelperStyle() overriding floating styles (native only) |
277 | 277 | this._updateContainerHeight(); |
278 | 278 | this.engine.addedNodes.push(node);// @ts-ignore |
279 | 279 | this._triggerAddEvent();// @ts-ignore |
@@ -413,16 +413,15 @@ GridStack.prototype._prepareDragDropByNode = function(this: GridStack, node: Gri |
413 | 413 | delete node.el; |
414 | 414 | el.remove(); |
415 | 415 | } else { |
416 | | - if (!node._temporaryRemoved) { |
417 | | - // move to new placeholder location |
418 | | - Utils.removePositioningStyles(target);// @ts-ignore |
419 | | - this._writePosAttr(target, node); |
420 | | - } else { |
| 416 | + Utils.removePositioningStyles(target); |
| 417 | + if (node._temporaryRemoved) { |
421 | 418 | // got removed - restore item back to before dragging position |
422 | | - Utils.removePositioningStyles(target); |
423 | 419 | Utils.copyPos(node, node._orig);// @ts-ignore |
424 | 420 | this._writePosAttr(target, node); |
425 | 421 | this.engine.addNode(node); |
| 422 | + } else { |
| 423 | + // move to new placeholder location |
| 424 | + this._writePosAttr(target, node); |
426 | 425 | } |
427 | 426 | if (this._gsEventHandler[event.type]) { |
428 | 427 | this._gsEventHandler[event.type](event, target); |
|
0 commit comments