mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37:56 +01:00
Fix zoom load on maps.
This commit is contained in:
parent
0246851f41
commit
c43faeb06a
@ -47,6 +47,7 @@ import { SpinnerCentered } from './style';
|
||||
export type EditorOptions = {
|
||||
mode: EditorRenderMode;
|
||||
locale: string;
|
||||
zoom: number;
|
||||
enableKeyboardEvents: boolean;
|
||||
};
|
||||
|
||||
@ -140,6 +141,7 @@ const Editor = ({
|
||||
id="mindmap-comp"
|
||||
mode={options.mode}
|
||||
locale={options.locale}
|
||||
zoom={options.zoom}
|
||||
/>
|
||||
|
||||
<Notifier id="headerNotifier" />
|
||||
|
@ -15,6 +15,7 @@ export type MindplotWebComponentInterface = {
|
||||
mode: string;
|
||||
ref: object;
|
||||
locale?: string;
|
||||
zoom?: number;
|
||||
};
|
||||
/**
|
||||
* WebComponent implementation for minplot designer.
|
||||
@ -60,6 +61,7 @@ class MindplotWebComponent extends HTMLElement {
|
||||
buildDesigner(persistence?: PersistenceManager, widgetManager?: WidgetManager) {
|
||||
const editorRenderMode = this.getAttribute('mode') as EditorRenderMode;
|
||||
const locale = this.getAttribute('locale');
|
||||
const zoom = this.getAttribute('zoom');
|
||||
|
||||
const persistenceManager = persistence || new LocalStorageManager('map.xml', false, false);
|
||||
const mode = editorRenderMode || 'viewonly';
|
||||
@ -69,7 +71,7 @@ class MindplotWebComponent extends HTMLElement {
|
||||
widgetManager,
|
||||
divContainer: this._shadowRoot.getElementById('mindplot'),
|
||||
container: 'mindplot',
|
||||
zoom: 1,
|
||||
zoom: zoom ? Number.parseFloat(zoom) : 1,
|
||||
locale: locale || 'en',
|
||||
});
|
||||
this._designer = buildDesigner(options);
|
||||
|
@ -12,10 +12,7 @@ class EditorOptionsBuilder {
|
||||
|
||||
if (!AppConfig.isDevelopEnv()) {
|
||||
options = {
|
||||
zoom:
|
||||
globalThis.userOptions?.zoom != undefined
|
||||
? Number.parseFloat(globalThis?.userOptions?.zoom as string)
|
||||
: 0.8,
|
||||
zoom: globalThis.userOptions?.zoom ? globalThis?.userOptions?.zoom : 0.8,
|
||||
locked: globalThis.mindmapLocked,
|
||||
lockedMsg: globalThis.mindmapLockedMsg,
|
||||
mapTitle: globalThis.mapTitle,
|
||||
|
Loading…
Reference in New Issue
Block a user