diff options
author | Eleanor Eng <eleanoreng@eleanors-mbp.devices.brown.edu> | 2019-02-25 18:58:45 -0500 |
---|---|---|
committer | Eleanor Eng <eleanoreng@eleanors-mbp.devices.brown.edu> | 2019-02-25 18:58:45 -0500 |
commit | 8d3ebd1eb393baf37932d021d6da79d46ef96a03 (patch) | |
tree | f6e0ef0cce9041525bcd5f6e0a37eee9226a9896 /src/fields/TextField.ts | |
parent | fa2be8b245e4ed69b771e70a98e65176785751eb (diff) | |
parent | 292ff1a8d75f8b15f9388d2c577e09a13836d5dc (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into contextMenu
Diffstat (limited to 'src/fields/TextField.ts')
-rw-r--r-- | src/fields/TextField.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/fields/TextField.ts b/src/fields/TextField.ts index 11d2ed7cd..71d8ea310 100644 --- a/src/fields/TextField.ts +++ b/src/fields/TextField.ts @@ -1,8 +1,10 @@ import { BasicField } from "./BasicField" +import { FieldId } from "./Field"; +import { Types } from "../server/Message"; export class TextField extends BasicField<string> { - constructor(data: string = "") { - super(data); + constructor(data: string = "", id?: FieldId, save: boolean = true) { + super(data, save, id); } ToScriptString(): string { @@ -12,4 +14,12 @@ export class TextField extends BasicField<string> { Copy() { return new TextField(this.Data); } -} + + ToJson(): { type: Types, data: string, _id: string } { + return { + type: Types.Text, + data: this.Data, + _id: this.Id + } + } +}
\ No newline at end of file |