Fix readonly setting typo

This commit is contained in:
Paulo Gustavo Veiga 2021-12-24 17:30:36 -08:00
parent 6742950ab4
commit 87115cda37
2 changed files with 14 additions and 4 deletions

View File

@ -1,10 +1,17 @@
/* eslint-disable import/no-unresolved */
/* eslint-disable no-undef */
/* eslint-disable vars-on-top */
import { $notify } from '@wisemapping/core-js';
import jquery from 'jquery';
import { $notify } from './components/widget/ToolbarNotifier';
import { buildDesigner, buildOptions } from './components/DesignerBuilder';
import RESTPersistenceManager from './components/RestPersistenceManager';
import PersistenceManager from './components/PersistenceManager';
import LocalStorageManager from './components/LocalStorageManager';
// This hack is required to initialize Bootstrap. In future, this should be removed.
global.jQuery = jquery;
require('@libraries/bootstrap/js/bootstrap');
// Configure designer options ...
let persistence;
if (!global.memoryPersistence && !global.readOnlyMode) {
@ -25,7 +32,7 @@ if (!global.memoryPersistence && !global.readOnlyMode) {
const options = buildOptions({
persistenceManager: persistence,
isReadOnly: global.readOnlyMode || false,
readOnly: global.readOnly || false,
mapId: global.mapId,
zoom: global.userOptions.zoom,
});

View File

@ -3,9 +3,12 @@ import { buildDesigner, buildOptions } from '../../../../src/components/Designer
import { PersistenceManager, LocalStorageManager } from '../../../../src';
const p = new LocalStorageManager('samples/{id}.xml');
const options = buildOptions({ persistenceManager: p, readOnly: false });
const options = buildOptions({ persistenceManager: p, readOnly: true, saveOnLoad: false });
// Obtain map id from query param
const params = new URLSearchParams(window.location.search.substring(1));
const mapId = params.get('id') || 'welcome';
const mapId = 'welcome';
const designer = buildDesigner(options);
designer.addEvent('loadSuccess', () => {
document.getElementById('mindplot').classList.add('ready');