diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-01-18 20:29:10 -0500 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-01-18 20:29:10 -0500 |
commit | 05138b7f0366e1854ebaabbea1dcc41fb7666b3d (patch) | |
tree | eb6fbdef31ee94fc6bfb8db39af50354e450ce7e | |
parent | 4d2bd0796c839b25ed9b96319957d02fbe452aca (diff) | |
parent | 657b07e5a0a4d73a0b9cd9b82b69178b1658ce8b (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into move_doc_get_out_the_way
-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 { |