diff options
Diffstat (limited to 'src/fields/Document.ts')
| -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) { |
