diff options
| author | bob <bcz@cs.brown.edu> | 2019-01-30 11:12:52 -0500 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-01-30 11:12:52 -0500 |
| commit | 8866e324bd7ea8dd03814a840662ca7c3b1a8e0f (patch) | |
| tree | c27d9a015078524a25c734d841212e334d17cf67 /src/fields | |
| parent | 022b8a3a562a30062f714f9ce7082b8983a89513 (diff) | |
cleaned up so that its easy to switch between flexLayout and GoldenLayout
Diffstat (limited to 'src/fields')
| -rw-r--r-- | src/fields/Document.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 6b1cccaf9..9580ab5c0 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -1,10 +1,15 @@ import { Field, Cast, Opt } from "./Field" import { Key, KeyStore } from "./Key" -import { ObservableMap } from "mobx"; +import { ObservableMap, computed } from "mobx"; +import { TextField } from "./TextField"; export class Document extends Field { private fields: ObservableMap<Key, Field> = new ObservableMap(); + static _untitledDocName = "<untitled>"; + @computed + public get Title() { return this.GetFieldValue(KeyStore.Title, TextField, Document._untitledDocName); } + GetField(key: Key, ignoreProto: boolean = false): Opt<Field> { let field: Opt<Field>; if (ignoreProto) { |
