From c415fb65e3d87b851015fb2ac7c41361609e0719 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 20 Jun 2022 16:27:39 -0400
Subject: fixed contextmenu when hitting enter to not iconify.  fixed : menu to
 add equations properly.

---
 src/client/views/DocumentDecorations.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index b666b5977..d22fb5f01 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -7,8 +7,8 @@ import { DateField } from '../../fields/DateField';
 import { AclAdmin, AclEdit, DataSym, Doc, DocListCast, Field, HeightSym, WidthSym } from "../../fields/Doc";
 import { Document } from '../../fields/documentSchemas';
 import { InkField } from "../../fields/InkField";
-import { ScriptField } from '../../fields/ScriptField';
-import { Cast, NumCast, StrCast } from "../../fields/Types";
+import { ComputedField, ScriptField } from '../../fields/ScriptField';
+import { Cast, FieldValue, NumCast, StrCast } from "../../fields/Types";
 import { GetEffectiveAcl } from '../../fields/util';
 import { emptyFunction, returnFalse, setupMoveUpEvents } from "../../Utils";
 import { Docs } from "../documents/Documents";
@@ -461,6 +461,9 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
                         return ScriptField.MakeFunction(this._titleControlString.substring(1), { doc: Doc.name })!.script.run({ self: selected.rootDoc, this: selected.layoutDoc }, console.log).result?.toString() || "";
                   }
                   if (this._titleControlString.startsWith("#")) {
+                    const cfield = ComputedField.WithoutComputed(() => FieldValue(selected.props.Document.title));
+                      console.log(cfield);
+                      (cfield as any)?.script.run().result;
                         return Field.toString(selected.props.Document[this._titleControlString.substring(1)] as Field) || "-unset-";
                   }
                   return this._accumulatedTitle;
-- 
cgit v1.2.3-70-g09d2

