aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-06-23 11:15:17 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-06-23 11:15:17 +0530
commitb6d1ecd0a63ce7aef3d0592a2a6882dc3255d4ca (patch)
tree13d63b23f0585639ede21dde25ca375a21ba3936 /src/client/util/SelectionManager.ts
parentfd8bcfb19f0c45757c60a9d63bf56753e9dcb12f (diff)
parent87150752e9ec0b984209a3e4fa757dfee18a788b (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into acls_uv
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 05515e502..eb905d237 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -10,13 +10,17 @@ export namespace SelectionManager {
@observable IsDragging: boolean = false;
SelectedDocuments: ObservableMap<DocumentView, boolean> = new ObservableMap();
-
+ clearSelection() {
+ if (window.getSelection) { window.getSelection()?.removeAllRanges(); }
+ else if (document.getSelection()) { document.getSelection()?.empty(); }
+ }
@action
SelectDoc(docView: DocumentView, ctrlPressed: boolean): void {
// if doc is not in SelectedDocuments, add it
if (!manager.SelectedDocuments.get(docView)) {
if (!ctrlPressed) {
this.DeselectAll();
+ this.clearSelection();
}
manager.SelectedDocuments.set(docView, true);