diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-06 16:04:02 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-06 16:04:02 -0400 |
commit | b6eae4662c8422f269a4e2ec810e0e94a4b5089d (patch) | |
tree | edd02b0124d52a4ac48d02f88f31fa8d1d2ef332 /src/fields/Document.ts | |
parent | 0703e2c8556d2b3219e575987657f95a89a13f76 (diff) | |
parent | b680f3db2f9fb6dc65f47848234e96453ef60a5c (diff) |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into propsRefactor
Diffstat (limited to 'src/fields/Document.ts')
-rw-r--r-- | src/fields/Document.ts | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 8eca5e30c..3f26abbda 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -308,24 +308,14 @@ export class Document extends Field { } @action - SetDataOnPrototype<T, U extends Field & { Data: T }>( - key: Key, - value: T, - ctor: { new(): U }, - replaceWrongType = true - ) { + SetDataOnPrototype<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) { this.GetTAsync(KeyStore.Prototype, Document, (f: Opt<Document>) => { - f && f.SetData(key, value, ctor); + f && f.SetData(key, value, ctor, replaceWrongType); }); } @action - SetData<T, U extends Field & { Data: T }>( - key: Key, - value: T, - ctor: { new(data: T): U }, - replaceWrongType = true - ) { + SetData<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(data: T): U }, replaceWrongType = true) { let field = this.Get(key, true); if (field instanceof ctor) { field.Data = value; @@ -386,11 +376,7 @@ export class Document extends Field { } GetValue() { return this.Title; - var title = - (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + - "(" + - this.Id + - ")"; + var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; return title; //throw new Error("Method not implemented."); } |