diff options
Diffstat (limited to 'src/fields')
| -rw-r--r-- | src/fields/Document.ts | 10 | ||||
| -rw-r--r-- | src/fields/Field.ts | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 004bfa4c0..99cd03813 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -10,7 +10,7 @@ import { Types } from "../server/Message"; export class Document extends Field { public fields: ObservableMap<Key, Opt<Field>> = new ObservableMap(); - public _proxies: ObservableMap<Key, FIELD_ID> = new ObservableMap(); + public _proxies: ObservableMap<string, FIELD_ID> = new ObservableMap(); @computed public get Title() { @@ -22,18 +22,18 @@ export class Document extends Field { if (ignoreProto) { if (this.fields.has(key)) { field = this.fields.get(key); - } else if (this._proxies.has(key)) { + } else if (this._proxies.has(key.Id)) { field = Server.GetDocumentField(this, key); } } else { let doc: FieldValue<Document> = this; while (doc && doc != FieldWaiting && field != FieldWaiting) { if (!doc.fields.has(key)) { - if (doc._proxies.has(key)) { + if (doc._proxies.has(key.Id)) { field = Server.GetDocumentField(doc, key); break; } - if ((doc.fields.has(KeyStore.Prototype) || doc._proxies.has(KeyStore.Prototype))) { + if ((doc.fields.has(KeyStore.Prototype) || doc._proxies.has(KeyStore.Prototype.Id))) { doc = doc.GetPrototype(); } else break; @@ -160,7 +160,7 @@ export class Document extends Field { let fields: [string, string][] = [] this._proxies.forEach((field, key) => { if (field) { - fields.push([key.Id as string, field as string]) + fields.push([key, field as string]) } }); diff --git a/src/fields/Field.ts b/src/fields/Field.ts index 03c2da7be..1a5cfb29c 100644 --- a/src/fields/Field.ts +++ b/src/fields/Field.ts @@ -28,8 +28,8 @@ export type FieldValue<T> = Opt<T> | FIELD_WAITING; export abstract class Field { //FieldUpdated: TypedEvent<Opt<FieldUpdatedArgs>> = new TypedEvent<Opt<FieldUpdatedArgs>>(); - private id: FIELD_ID; - get Id(): FIELD_ID { + private id: string; + get Id(): string { return this.id; } @@ -87,6 +87,7 @@ export abstract class Field { let doc: Document = new Document(id) let fields: [string, string][] = data as [string, string][] fields.forEach(element => { + doc._proxies.set(element[0], element[1]); let keyId: string = element[0] let valueId: string = element[1] Server.GetField(keyId, (key: Field) => { |
