aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index a3d6f5227..1a2dda953 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -4,6 +4,7 @@ import { Doc, Opt } from '../../fields/Doc';
import { DocCast } from '../../fields/Types';
import { CollectionViewType, DocumentType } from '../documents/DocumentTypes';
import { DocumentView } from '../views/nodes/DocumentView';
+import { LinkManager } from './LinkManager';
import { ScriptingGlobals } from './ScriptingGlobals';
export namespace SelectionManager {
@@ -15,6 +16,7 @@ export namespace SelectionManager {
@action
SelectSchemaViewDoc(doc: Opt<Doc>) {
manager.SelectedSchemaDocument = doc;
+ if (doc?.type === DocumentType.LINK) LinkManager.currentLink = doc;
}
@action
SelectView(docView: DocumentView, ctrlPressed: boolean): void {
@@ -32,6 +34,7 @@ export namespace SelectionManager {
manager.SelectedViews.clear();
manager.SelectedViews.set(docView, docView.rootDoc);
}
+ if (docView.rootDoc.type === DocumentType.LINK) LinkManager.currentLink = docView.rootDoc;
}
@action
DeselectView(docView: DocumentView): void {
@@ -42,6 +45,7 @@ export namespace SelectionManager {
}
@action
DeselectAll(): void {
+ LinkManager.currentLink = undefined;
manager.SelectedSchemaDocument = undefined;
Array.from(manager.SelectedViews.keys()).forEach(dv => dv.props.whenChildContentsActiveChanged(false));
manager.SelectedViews.clear();