diff options
Diffstat (limited to 'src/fields')
-rw-r--r-- | src/fields/BooleanField.ts | 2 | ||||
-rw-r--r-- | src/fields/Document.ts | 22 |
2 files changed, 5 insertions, 19 deletions
diff --git a/src/fields/BooleanField.ts b/src/fields/BooleanField.ts index 7378b30a1..d319b4021 100644 --- a/src/fields/BooleanField.ts +++ b/src/fields/BooleanField.ts @@ -17,7 +17,7 @@ export class BooleanField extends BasicField<boolean> { ToJson(): { type: Types; data: boolean; _id: string } { return { - type: Types.Minimized, + type: Types.Boolean, data: this.Data, _id: this.Id }; 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."); } |