aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/MainView.tsx14
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx5
2 files changed, 13 insertions, 6 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index d0d77bbf4..c3f3a63de 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -57,10 +57,16 @@ export class MainView extends React.Component {
MainView.Instance = this;
// causes errors to be generated when modifying an observable outside of an action
configure({ enforceActions: "observed" });
+ if (window.location.search.includes("readonly")) {
+ DocServer.makeReadOnly();
+ }
if (window.location.pathname !== RouteStore.home) {
- let pathname = window.location.pathname.split("/");
- if (pathname.length > 1 && pathname[pathname.length - 2] === 'doc') {
- CurrentUserUtils.MainDocId = pathname[pathname.length - 1];
+ let pathname = window.location.pathname.substr(1).split("/");
+ if (pathname.length > 1) {
+ let type = pathname[0];
+ if (type === "doc") {
+ CurrentUserUtils.MainDocId = pathname[1];
+ }
}
}
@@ -120,7 +126,7 @@ export class MainView extends React.Component {
if (list) {
let freeformDoc = Docs.FreeformDocument([], { x: 0, y: 400, title: `WS collection ${list.length + 1}` });
var dockingLayout = { content: [{ type: 'row', content: [CollectionDockingView.makeDocumentConfig(CurrentUserUtils.UserDocument, 150), CollectionDockingView.makeDocumentConfig(freeformDoc, 600)] }] };
- let mainDoc = Docs.DockDocument([CurrentUserUtils.UserDocument, freeformDoc], JSON.stringify(dockingLayout), { title: `Workspace ${list.length + 1}` });
+ let mainDoc = Docs.DockDocument([CurrentUserUtils.UserDocument, freeformDoc], JSON.stringify(dockingLayout), { title: `Workspace ${list.length + 1}` }, id);
list.push(mainDoc);
// bcz: strangely, we need a timeout to prevent exceptions/issues initializing GoldenLayout (the rendering engine for Main Container)
setTimeout(() => {
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 5aa268e36..eeec3eaf0 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -438,10 +438,11 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
get previewPanelCenteringOffset() { return (this._panelWidth - this.nativeWidth() * this.contentScaling()) / 2; }
addDocTab = (doc: Doc, location: string) => {
- if (location === "onRight")
+ if (location === "onRight") {
CollectionDockingView.Instance.AddRightSplit(doc);
- else
+ } else {
CollectionDockingView.Instance.AddTab(this._stack, doc);
+ }
}
get content() {
if (!this._document) {