From 64b71d1f652bb3a7523ed3914d93f4603ae9fe98 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 15 Dec 2020 13:29:15 -0500 Subject: fixed previous problems -- weird that you can't call componentWillUnmount. also fixed dragging to show original unless hideSource is set --- src/client/util/DragManager.ts | 3 +-- src/client/views/nodes/DocumentView.tsx | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index 1a58b4bf1..bebdc8bb2 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -412,13 +412,12 @@ export namespace DragManager { return dragElement; }); - const hideSource = options?.hideSource ? true : false; const hideDragShowOriginalElements = (hide: boolean) => { dragLabel.style.display = hide ? "" : "none"; !hide && dragElements.map(dragElement => dragElement.parentNode === dragDiv && dragDiv.removeChild(dragElement)); eles.forEach(ele => ele.hidden = hide); }; - hideDragShowOriginalElements(hideSource); + options?.hideSource && hideDragShowOriginalElements(true); SnappingManager.SetIsDragging(true); let lastX = downX; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index da10f2a69..eb1807a71 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -153,9 +153,10 @@ export class DocumentViewInternal extends DocComponent { // continue if the event hasn't been canceled AND we are using a moues or this is has an onClick or onDragStart function (meaning it is a button document) @@ -732,7 +733,7 @@ export class DocumentViewInternal extends DocComponent { return this.props.isSelected(outsideReaction) || (this.props.Document.rootDocument && this.props.rootSelected?.(outsideReaction)) || false; } + rootSelected = (outsideReaction?: boolean) => this.props.isSelected(outsideReaction) || (this.props.Document.rootDocument && this.props.rootSelected?.(outsideReaction)) || false; panelHeight = () => this.props.PanelHeight() - this.headerMargin; parentActive = (outsideReaction: boolean) => this.props.layerProvider?.(this.layoutDoc) === false ? this.props.parentActive(outsideReaction) : false; screenToLocal = () => this.props.ScreenToLocalTransform().translate(0, -this.headerMargin); -- cgit v1.2.3-70-g09d2