diff --git a/packages/mindplot/src/components/Designer.ts b/packages/mindplot/src/components/Designer.ts index b1ab5dae..a17b0189 100644 --- a/packages/mindplot/src/components/Designer.ts +++ b/packages/mindplot/src/components/Designer.ts @@ -110,7 +110,7 @@ class Designer extends Events { // Init Screen manager.. const screenManager = new ScreenManager(divElement); - this._workspace = new Workspace(screenManager, this._model.getZoom(), options.mode === 'viewonly'); + this._workspace = new Workspace(screenManager, this._model.getZoom(), this.isReadOnly()); // Init layout manager ... this._eventBussDispatcher = new EventBusDispatcher(); @@ -623,7 +623,7 @@ class Designer extends Events { } isReadOnly(): boolean { - return Boolean(this._options?.mode === 'viewonly'); + return this._options.mode === 'viewonly' || this._options.mode === 'edition-viewer'; } nodeModelToTopic(nodeModel: NodeModel): Topic { diff --git a/packages/mindplot/src/components/DesignerOptionsBuilder.ts b/packages/mindplot/src/components/DesignerOptionsBuilder.ts index 02a1a2e1..a4e0ac53 100644 --- a/packages/mindplot/src/components/DesignerOptionsBuilder.ts +++ b/packages/mindplot/src/components/DesignerOptionsBuilder.ts @@ -42,7 +42,6 @@ class OptionsBuilder { width: window.screen.width, height: window.screen.height, }; - console.log(`height:${containerSize.height}`); } const defaultOptions: DesignerOptions = { diff --git a/packages/webapp/src/components/editor-page/EditorOptionsBuider.ts b/packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts similarity index 96% rename from packages/webapp/src/components/editor-page/EditorOptionsBuider.ts rename to packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts index 7342bb0e..cf6a2ff7 100644 --- a/packages/webapp/src/components/editor-page/EditorOptionsBuider.ts +++ b/packages/webapp/src/components/editor-page/EditorOptionsBuilder.ts @@ -2,7 +2,7 @@ import { EditorOptions } from '@wisemapping/editor'; import { EditorRenderMode } from '@wisemapping/mindplot'; import AppConfig from '../../classes/app-config'; -export default class EditorOptionsBulder { +export default class EditorOptionsBuilder { static build(locale: string, mode: EditorRenderMode, hotkeys: boolean): EditorOptions { let options: EditorOptions = { diff --git a/packages/webapp/src/components/editor-page/index.tsx b/packages/webapp/src/components/editor-page/index.tsx index 4fa8c7bb..56f47682 100644 --- a/packages/webapp/src/components/editor-page/index.tsx +++ b/packages/webapp/src/components/editor-page/index.tsx @@ -10,7 +10,7 @@ import { hotkeysEnabled } from '../../redux/editorSlice'; import ReactGA from 'react-ga'; import Client from '../../classes/client'; import { activeInstance, fetchAccount, fetchMapById } from '../../redux/clientSlice'; -import EditorOptionsBulder from './EditorOptionsBuider'; +import EditorOptionsBuilder from './EditorOptionsBuilder'; export type EditorPropsType = { isTryMode: boolean; @@ -45,7 +45,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { } // What is the role ? - const mapId = EditorOptionsBulder.loadMapId(); + const mapId = EditorOptionsBuilder.loadMapId(); const mode = findEditorMode(isTryMode, mapId); // Account settings can be null and editor cannot be initilized multiple times. This creates problems @@ -55,7 +55,7 @@ const EditorPage = ({ isTryMode }: EditorPropsType): React.ReactElement => { let options, persistence: PersistenceManager; if (loadCompleted) { - options = EditorOptionsBulder.build(userLocale.code, mode, hotkey); + options = EditorOptionsBuilder.build(userLocale.code, mode, hotkey); persistence = client.buildPersistenceManager(mode); }