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.ts24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 8c92c2023..5311841e1 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -21,6 +21,13 @@ export namespace SelectionManager {
doc.props.whenActiveChanged(true);
}
}
+ @action
+ DeSelectDoc(doc: DocumentView): void {
+ if (manager.SelectedDocuments.indexOf(doc) !== -1) {
+ manager.SelectedDocuments.splice(manager.SelectedDocuments.indexOf(doc), 1);
+ doc.props.whenActiveChanged(false);
+ }
+ }
@action
DeselectAll(): void {
@@ -28,16 +35,6 @@ export namespace SelectionManager {
manager.SelectedDocuments = [];
FormattedTextBox.InputBoxOverlay = undefined;
}
- @action
- ReselectAll() {
- let sdocs = manager.SelectedDocuments.map(d => d);
- manager.SelectedDocuments = [];
- return sdocs;
- }
- @action
- ReselectAll2(sdocs: DocumentView[]) {
- sdocs.map(s => SelectionManager.SelectDoc(s, true));
- }
}
const manager = new Manager();
@@ -49,6 +46,9 @@ export namespace SelectionManager {
export function IsSelected(doc: DocumentView): boolean {
return manager.SelectedDocuments.indexOf(doc) !== -1;
}
+ export function DeSelectDoc(doc: DocumentView): void {
+ manager.DeSelectDoc(doc);
+ }
export function DeselectAll(except?: Doc): void {
let found: DocumentView | undefined = undefined;
@@ -62,10 +62,6 @@ export namespace SelectionManager {
if (found) manager.SelectDoc(found, false);
}
- export function ReselectAll() {
- let sdocs = manager.ReselectAll();
- setTimeout(() => manager.ReselectAll2(sdocs), 0);
- }
export function SelectedDocuments(): Array<DocumentView> {
return manager.SelectedDocuments;
}