From e3ed4251ed7a397482d1b79a2c696e7797b7b1d6 Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Mon, 9 Oct 2023 20:48:42 +0100 Subject: [PATCH] chore: revert --- .../src/dnd/abstractDragHandler.ts | 22 ++----------------- .../src/dockview/components/tab/tab.ts | 7 ------ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/packages/dockview-core/src/dnd/abstractDragHandler.ts b/packages/dockview-core/src/dnd/abstractDragHandler.ts index f4700a636..306ab236e 100644 --- a/packages/dockview-core/src/dnd/abstractDragHandler.ts +++ b/packages/dockview-core/src/dnd/abstractDragHandler.ts @@ -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(); @@ -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); diff --git a/packages/dockview-core/src/dockview/components/tab/tab.ts b/packages/dockview-core/src/dockview/components/tab/tab.ts index 4f8c9430f..48da83a85 100644 --- a/packages/dockview-core/src/dockview/components/tab/tab.ts +++ b/packages/dockview-core/src/dockview/components/tab/tab.ts @@ -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 {