diff options
author | laurawilsonri <laura_wilson@brown.edu> | 2019-04-08 19:10:03 -0400 |
---|---|---|
committer | laurawilsonri <laura_wilson@brown.edu> | 2019-04-08 19:10:03 -0400 |
commit | 74411165f21b6c616fa98e0676c6f4568c2d4564 (patch) | |
tree | 38079f721f8cdeba25e7bc0439aa5d6523927f1c /src/client/util/SelectionManager.ts | |
parent | 5d4414e8d2a17c75c808bce9343dba85fbb32440 (diff) | |
parent | a72fcdd0ebc06a3c851007c6ed89ab13a9a0d835 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into richTextEditor
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r-- | src/client/util/SelectionManager.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts index 1354e32e1..79d4ceb25 100644 --- a/src/client/util/SelectionManager.ts +++ b/src/client/util/SelectionManager.ts @@ -1,6 +1,7 @@ import { observable, action } from "mobx"; import { DocumentView } from "../views/nodes/DocumentView"; -import { Document } from "../../fields/Document" +import { Document } from "../../fields/Document"; +import { Main } from "../views/Main"; export namespace SelectionManager { class Manager { @@ -15,15 +16,15 @@ export namespace SelectionManager { } if (manager.SelectedDocuments.indexOf(doc) === -1) { - manager.SelectedDocuments.push(doc) + manager.SelectedDocuments.push(doc); } } } - const manager = new Manager; + const manager = new Manager(); export function SelectDoc(doc: DocumentView, ctrlPressed: boolean): void { - manager.SelectDoc(doc, ctrlPressed) + manager.SelectDoc(doc, ctrlPressed); } export function IsSelected(doc: DocumentView): boolean { @@ -35,16 +36,15 @@ export namespace SelectionManager { if (except) { for (let i = 0; i < manager.SelectedDocuments.length; i++) { let view = manager.SelectedDocuments[i]; - if (view.props.Document == except) - found = view; + if (view.props.Document == except) found = view; } } manager.SelectedDocuments.length = 0; - if (found) - manager.SelectedDocuments.push(found); + if (found) manager.SelectedDocuments.push(found); + Main.Instance.SetTextDoc(undefined, undefined); } export function SelectedDocuments(): Array<DocumentView> { return manager.SelectedDocuments; } -}
\ No newline at end of file +} |