diff options
| author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-02-05 19:37:48 -0500 |
|---|---|---|
| committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-02-05 19:37:48 -0500 |
| commit | 6a13071a695732b2235f988278c52d0072af0fb5 (patch) | |
| tree | 94d6ccf16572463520fd744e41988b1dc8c7b7e3 /src/util | |
| parent | 41afca0448b4e75459fc8aeb53192f6a44aa2b18 (diff) | |
| parent | 6e66f8b227c730e07863a93a8bce5ee0d51d2ddc (diff) | |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into scripting
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/DragManager.ts | 2 | ||||
| -rw-r--r-- | src/util/Scripting.ts | 3 | ||||
| -rw-r--r-- | src/util/SelectionManager.ts | 12 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/util/DragManager.ts b/src/util/DragManager.ts index b4132a222..63d6a88f8 100644 --- a/src/util/DragManager.ts +++ b/src/util/DragManager.ts @@ -1,5 +1,5 @@ import { Opt } from "../fields/Field"; -import { DocumentView } from "../views/nodes/DocumentView"; +import { CollectionFreeFormDocumentView } from "../views/nodes/CollectionFreeFormDocumentView"; import { DocumentDecorations } from "../DocumentDecorations"; import { SelectionManager } from "./SelectionManager"; import { CollectionDockingView } from "../views/collections/CollectionDockingView"; diff --git a/src/util/Scripting.ts b/src/util/Scripting.ts index e8c036c43..94339e7fe 100644 --- a/src/util/Scripting.ts +++ b/src/util/Scripting.ts @@ -1,4 +1,5 @@ // import * as ts from "typescript" +let ts = (window as any).ts; import { Opt, Field } from "../fields/Field"; import { Document as DocumentImport } from "../fields/Document"; import { NumberField as NumberFieldImport } from "../fields/NumberField"; @@ -13,7 +14,7 @@ export interface ExecutableScript { } function ExecScript(script: string, diagnostics: Opt<any[]>): ExecutableScript { - const compiled = !(diagnostics && diagnostics.some(diag => diag.category == 1)); + const compiled = !(diagnostics && diagnostics.some(diag => diag.category == ts.DiagnosticCategory.Error)); let func: () => Opt<Field>; if (compiled) { diff --git a/src/util/SelectionManager.ts b/src/util/SelectionManager.ts index 2a63248c4..0759ae110 100644 --- a/src/util/SelectionManager.ts +++ b/src/util/SelectionManager.ts @@ -1,13 +1,13 @@ -import { DocumentView } from "../views/nodes/DocumentView"; +import { CollectionFreeFormDocumentView } from "../views/nodes/CollectionFreeFormDocumentView"; import { observable, action } from "mobx"; export namespace SelectionManager { class Manager { @observable - SelectedDocuments: Array<DocumentView> = []; + SelectedDocuments: Array<CollectionFreeFormDocumentView> = []; @action - SelectDoc(doc: DocumentView, ctrlPressed: boolean): void { + SelectDoc(doc: CollectionFreeFormDocumentView, ctrlPressed: boolean): void { // if doc is not in SelectedDocuments, add it if (!ctrlPressed) { manager.SelectedDocuments = []; @@ -21,11 +21,11 @@ export namespace SelectionManager { const manager = new Manager; - export function SelectDoc(doc: DocumentView, ctrlPressed: boolean): void { + export function SelectDoc(doc: CollectionFreeFormDocumentView, ctrlPressed: boolean): void { manager.SelectDoc(doc, ctrlPressed) } - export function IsSelected(doc: DocumentView): boolean { + export function IsSelected(doc: CollectionFreeFormDocumentView): boolean { return manager.SelectedDocuments.indexOf(doc) !== -1; } @@ -33,7 +33,7 @@ export namespace SelectionManager { manager.SelectedDocuments = [] } - export function SelectedDocuments(): Array<DocumentView> { + export function SelectedDocuments(): Array<CollectionFreeFormDocumentView> { return manager.SelectedDocuments; } }
\ No newline at end of file |
