diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.tsx | 4 | ||||
-rw-r--r-- | src/fields/Document.ts | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Main.tsx b/src/Main.tsx index 461ee637a..f911b6098 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -53,8 +53,12 @@ runInAction(() => { let doc4 = Documents.CollectionDocument(docset, { x: 100, y: 400 }); + let doc5 = Documents.ImageDocument("https://static.boredpanda.com/blog/wp-content/uploads/2018/04/5acb63d83493f__700-png.jpg", { + x: 650, y: 500 + }); mainNodeCollection.Docs.push(doc1); mainNodeCollection.Docs.push(doc2); mainNodeCollection.Docs.push(doc4); mainNodeCollection.Docs.push(doc3); + mainNodeCollection.Docs.push(doc5); });
\ No newline at end of file diff --git a/src/fields/Document.ts b/src/fields/Document.ts index c315beaef..0bba9c21e 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -5,7 +5,7 @@ import { ObservableMap } from "mobx"; export class Document extends Field { private fields: ObservableMap<Key, Field> = new ObservableMap(); - GetField(key: Key, ignoreProto?: boolean): Opt<Field> { + GetField(key: Key, ignoreProto: boolean = false): Opt<Field> { let field: Opt<Field>; if (ignoreProto) { if (this.fields.has(key)) { @@ -43,7 +43,7 @@ export class Document extends Field { } SetFieldValue<T extends Field>(key: Key, value: any, ctor: { new(): T }): boolean { - let field = this.GetField(key); + let field = this.GetField(key, true); if (field != null) { return field.TrySetValue(value); } else { |