aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-04-20 01:33:50 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-04-20 01:33:50 -0400
commit4bf22b6095cee078403e4ac11743e7aaa557956c (patch)
treea11b9db9df6165d92a51b1e74ed741c81d52e622 /src/fields
parente3ad2c2c8f920a5538541b8e495af52815e36dc6 (diff)
parent425ea0bacbb40312c5f722f27bf0ca93fe0b17b3 (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into newDocs
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/IconFIeld.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fields/IconFIeld.ts b/src/fields/IconFIeld.ts
new file mode 100644
index 000000000..a6694cc49
--- /dev/null
+++ b/src/fields/IconFIeld.ts
@@ -0,0 +1,25 @@
+import { BasicField } from "./BasicField";
+import { FieldId } from "./Field";
+import { Types } from "../server/Message";
+
+export class IconField extends BasicField<string> {
+ constructor(data: string = "", id?: FieldId, save: boolean = true) {
+ super(data, save, id);
+ }
+
+ ToScriptString(): string {
+ return `new IconField("${this.Data}")`;
+ }
+
+ Copy() {
+ return new IconField(this.Data);
+ }
+
+ ToJson() {
+ return {
+ type: Types.Icon,
+ data: this.Data,
+ id: this.Id
+ };
+ }
+} \ No newline at end of file