Skip to content

Commit

Permalink
chore: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
mathuo committed Oct 9, 2023
1 parent 58e9f9b commit e3ed425
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
22 changes: 2 additions & 20 deletions packages/dockview-core/src/dnd/abstractDragHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
MutableDisposable,
} from '../lifecycle';

const CLONE_ELEMENT = true;

export abstract class DragHandler extends CompositeDisposable {
private readonly dataDisposable = new MutableDisposable();
private readonly pointerEventsDisposable = new MutableDisposable();
Expand Down Expand Up @@ -59,24 +57,8 @@ export abstract class DragHandler extends CompositeDisposable {
iframe.style.pointerEvents = 'none';
}

if (CLONE_ELEMENT && event.dataTransfer) {
const clone = this.el.cloneNode(true) as HTMLElement;
const styles = window.getComputedStyle(this.el);
clone.style.cssText = Object.values(styles)
.map((key) => `${key}:${styles.getPropertyValue(key)}`)
.join(';');
clone.classList.add('dv-dragged');

document.body.append(clone);
setTimeout(() => {
// clone.parentElement?.removeChild(clone);
}, 0);

event.dataTransfer.setDragImage(clone, 0, 0);
} else {
this.el.classList.add('dv-dragged');
setTimeout(() => this.el.classList.remove('dv-dragged'), 0);
}
this.el.classList.add('dv-dragged');
setTimeout(() => this.el.classList.remove('dv-dragged'), 0);

this.dataDisposable.value = this.getData(event);
this._onDragStart.fire(event);
Expand Down
7 changes: 0 additions & 7 deletions packages/dockview-core/src/dockview/components/tab/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ class TabDragHandler extends DragHandler {
private readonly panel: IDockviewPanel
) {
super(element);

this.onDragStart((e) => {
this.accessor.removePanel(this.panel, {
skipDispose: true,
removeEmptyGroup: true,
});
});
}

getData(event: DragEvent): IDisposable {
Expand Down

0 comments on commit e3ed425

Please sign in to comment.