aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-05-16 15:10:54 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-05-16 15:10:54 -0500
commitd7a21aa87bd214c33c511729ce6f98f1d70f0385 (patch)
tree0fc0ca4b39f1bd6f0caf9041ac85ae7fea717ded /src/client/views/MainView.tsx
parentc8a344c86535e14be09230a083b894c821453bc0 (diff)
parent9c3d461a9642a4596c55f642af2b55e186b0fe20 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into script_documents
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index f58313f06..3e4833052 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -256,8 +256,9 @@ export class MainView extends React.Component {
const mainDoc = Docs.Create.StandardCollectionDockingDocument([{ doc: freeformDoc, initialWidth: 600, path: [Doc.UserDoc().myCatalog as Doc] }], { title: `Workspace ${workspaceCount}` }, id, "row");
const toggleTheme = ScriptField.MakeScript(`self.darkScheme = !self.darkScheme`);
- mainDoc.contextMenuScripts = new List<ScriptField>([toggleTheme!]);
- mainDoc.contextMenuLabels = new List<string>(["Toggle Theme Colors"]);
+ const toggleComic = ScriptField.MakeScript(`toggleComicMode()`);
+ mainDoc.contextMenuScripts = new List<ScriptField>([toggleTheme!, toggleComic!]);
+ mainDoc.contextMenuLabels = new List<string>(["Toggle Theme Colors", "Toggle Comic Mode"]);
Doc.AddDocToList(workspaces, "data", mainDoc);
// bcz: strangely, we need a timeout to prevent exceptions/issues initializing GoldenLayout (the rendering engine for Main Container)
@@ -629,3 +630,4 @@ export class MainView extends React.Component {
}
}
Scripting.addGlobal(function freezeSidebar() { MainView.expandFlyout(); });
+Scripting.addGlobal(function toggleComicMode() { Doc.UserDoc().fontFamily = "Comic Sans MS"; Doc.UserDoc().renderStyle = Doc.UserDoc().renderStyle === "comic" ? undefined : "comic" });