diff options
author | bobzel <zzzman@gmail.com> | 2021-09-01 15:32:44 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-01 15:32:44 -0400 |
commit | c8b3de89219a07d466151f5b4633cc87f0d46ec3 (patch) | |
tree | 2d59552ad476f221afcb602f62a7ccac49eec1cc /src | |
parent | f3a3536ea4b31cf93748490f4b46a56c4775565f (diff) |
from last
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 20d7a650f..7463e192f 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -605,7 +605,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps } @undoBatch deleteClicked = () => this.props.removeDocument?.(this.props.Document); - @undoBatch setToggleDetail = () => this.Document.onClick = ScriptField.MakeScript(`toggleDetail(documentView, "${this.Document.layoutKey}")`, { documentView: "any" }); + @undoBatch setToggleDetail = () => this.Document.onClick = ScriptField.MakeScript(`toggleDetail(documentView, "${StrCast(this.Document.layoutKey).replace("layout_", "")}")`, { documentView: "any" }); @undoBatch @action drop = async (e: Event, de: DragManager.DropEvent) => { @@ -709,7 +709,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps !zorders && cm.addItem({ description: "ZOrder...", subitems: zorderItems, icon: "compass" }); onClicks.push({ description: "Enter Portal", event: this.makeIntoPortal, icon: "window-restore" }); - onClicks.push({ description: "Toggle Detail", event: () => this.Document.onClick = ScriptField.MakeScript(`toggleDetail(documentView, "${this.Document.layoutKey}")`, { documentView: "any" }), icon: "concierge-bell" }); + onClicks.push({ description: "Toggle Detail", event: this.setToggleDetail, icon: "concierge-bell" }); onClicks.push({ description: (this.Document.followLinkZoom ? "Don't" : "") + " zoom following link", event: () => this.Document.followLinkZoom = !this.Document.followLinkZoom, icon: this.Document.ignoreClick ? "unlock" : "lock" }); if (!this.Document.annotationOn) { @@ -1189,7 +1189,7 @@ export class DocumentView extends React.Component<DocumentViewProps> { } } -Scripting.addGlobal(function toggleDetail(dv: DocumentView, detailLayoutKey: string, primaryLayoutKey: string = "layout") { - if (dv.Document.layoutKey === detailLayoutKey) dv.switchViews(primaryLayoutKey !== "layout", primaryLayoutKey.replace("layout_", "")); - else dv.switchViews(true, detailLayoutKey.replace("layout_", "")); +Scripting.addGlobal(function toggleDetail(dv: DocumentView, detailLayoutKey: string) { + if (dv.Document.layoutKey === "layout_" + detailLayoutKey) dv.switchViews(false, "layout"); + else dv.switchViews(true, detailLayoutKey); });
\ No newline at end of file |