aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/WebBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r--src/client/views/nodes/WebBox.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 24cb08c4c..557adfc03 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -81,14 +81,12 @@ export class WebBox extends DocAnnotatableComponent<FieldViewProps, WebDocument>
@action
submitURL = () => {
- const script = KeyValueBox.CompileKVPScript(`new WebField("${this.url}")`);
- if (!script) return;
- KeyValueBox.ApplyKVPScript(this.props.Document, "data", script);
+ this.dataDoc[this.props.fieldKey] = new WebField(new URL(this.url));
}
@action
setURL() {
- const urlField: FieldResult<WebField> = Cast(this.props.Document.data, WebField);
+ const urlField: FieldResult<WebField> = Cast(this.dataDoc[this.props.fieldKey], WebField);
if (urlField) this.url = urlField.url.toString();
else this.url = "";
}