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.ts23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 6fb758eac..ec875fe4b 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -13,13 +13,9 @@ export namespace SelectionManager {
@observable IsDragging: boolean = false;
SelectedDocuments: ObservableMap<DocumentView, boolean> = new ObservableMap();
- @observable public lastSelection: DocumentView | undefined;
-
@action
SelectDoc(docView: DocumentView, ctrlPressed: boolean): void {
- this.lastSelection = docView;
-
// if doc is not in SelectedDocuments, add it
if (!manager.SelectedDocuments.get(docView)) {
if (!ctrlPressed) {
@@ -39,14 +35,6 @@ export namespace SelectionManager {
@action
DeselectDoc(docView: DocumentView): void {
- if (this.lastSelection === docView) {
- const list = Array.from(manager.SelectedDocuments.keys());
- if (list.length > 0) {
- this.lastSelection = list[list.length - 1];
- } else {
- this.lastSelection = undefined;
- }
- }
if (manager.SelectedDocuments.get(docView)) {
manager.SelectedDocuments.delete(docView);
docView.props.whenActiveChanged(false);
@@ -55,16 +43,11 @@ export namespace SelectionManager {
}
@action
DeselectAll(): void {
- this.lastSelection = undefined;
+
Array.from(manager.SelectedDocuments.keys()).map(dv => dv.props.whenActiveChanged(false));
manager.SelectedDocuments.clear();
Doc.UserDoc().activeSelection = new List<Doc>([]);
}
-
- @action
- getLast(): DocumentView | undefined {
- return this.lastSelection;
- }
}
const manager = new Manager();
@@ -76,10 +59,6 @@ export namespace SelectionManager {
manager.SelectDoc(docView, ctrlPressed);
}
- export function LastSelection(): DocumentView | undefined {
- return manager.getLast();
- }
-
// computed functions, such as used in IsSelected generate errors if they're called outside of a
// reaction context. Specifying the context with 'outsideReaction' allows an efficiency feature
// to avoid unnecessary mobx invalidations when running inside a reaction.