From 7e4d793eaa7e5b6b564355a11fa02a5611645f20 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 21 Mar 2025 18:58:21 -0400
Subject: trying to improve how data / layout / root and templtae docs are
 accessed.

---
 src/client/views/ScriptBox.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src/client/views/ScriptBox.tsx')

diff --git a/src/client/views/ScriptBox.tsx b/src/client/views/ScriptBox.tsx
index d05b0a6b6..52c0227d8 100644
--- a/src/client/views/ScriptBox.tsx
+++ b/src/client/views/ScriptBox.tsx
@@ -3,7 +3,6 @@ import { observer } from 'mobx-react';
 import * as React from 'react';
 import { emptyFunction } from '../../Utils';
 import { Doc, Opt } from '../../fields/Doc';
-import { DocData } from '../../fields/DocSymbols';
 import { ScriptField } from '../../fields/ScriptField';
 import { ScriptCast } from '../../fields/Types';
 import { DragManager } from '../util/DragManager';
@@ -101,7 +100,6 @@ export class ScriptBox extends React.Component<ScriptBoxProps> {
         );
     }
     // let l = docList(this.source[0].data).length; if (l) { let ind = this.target[0].index !== undefined ? (this.target[0].index+1) % l : 0;  this.target[0].index = ind;  this.target[0].proto = getProto(docList(this.source[0].data)[ind]);}
-    // eslint-disable-next-line react/sort-comp
     public static EditButtonScript(title: string, doc: Doc, fieldKey: string, clientX: number, clientY: number, contextParams?: { [name: string]: string }, defaultScript?: ScriptField) {
         let overlayDisposer: () => void = emptyFunction;
         const script = ScriptCast(doc[fieldKey]) || defaultScript;
@@ -119,7 +117,7 @@ export class ScriptBox extends React.Component<ScriptBoxProps> {
                 onCancel={overlayDisposer}
                 onSave={(text, onError) => {
                     if (!text) {
-                        doc[DocData][fieldKey] = undefined;
+                        doc['$' + fieldKey] = undefined;
                     } else {
                         const compScript = CompileScript(text, {
                             params: { this: Doc.name, ...contextParams },
@@ -142,7 +140,7 @@ export class ScriptBox extends React.Component<ScriptBoxProps> {
                         div.innerHTML = 'button';
                         params.length && DragManager.StartButtonDrag([div], text, doc.title + '-instance', {}, params, () => {}, clientX, clientY);
 
-                        doc[DocData][fieldKey] = new ScriptField(compScript);
+                        doc['$' + fieldKey] = new ScriptField(compScript);
                         overlayDisposer();
                     }
                 }}
-- 
cgit v1.2.3-70-g09d2

