mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-26 08:04:56 +01:00
Editor pane is not reandered until map is loaded.
This commit is contained in:
parent
3d8e8dce38
commit
e1fcaa0cd2
@ -20,7 +20,7 @@ import Popover from '@mui/material/Popover';
|
|||||||
import Model from '../classes/model/editor';
|
import Model from '../classes/model/editor';
|
||||||
import {
|
import {
|
||||||
buildAppBarConfig,
|
buildAppBarConfig,
|
||||||
buildToolbarConfig,
|
buildEditorPanelConfig,
|
||||||
buildZoomToolbarConfig,
|
buildZoomToolbarConfig,
|
||||||
} from './toolbar/toolbarConfigBuilder';
|
} from './toolbar/toolbarConfigBuilder';
|
||||||
|
|
||||||
@ -62,12 +62,6 @@ const Editor = ({
|
|||||||
setModel(model);
|
setModel(model);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (model) {
|
|
||||||
toolbarConfiguration.current = buildToolbarConfig(model.getDesigner());
|
|
||||||
}
|
|
||||||
}, [model]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (options.enableKeyboardEvents) {
|
if (options.enableKeyboardEvents) {
|
||||||
DesignerKeyboard.resume();
|
DesignerKeyboard.resume();
|
||||||
@ -108,9 +102,9 @@ const Editor = ({
|
|||||||
>
|
>
|
||||||
{widgetManager.getEditorContent()}
|
{widgetManager.getEditorContent()}
|
||||||
</Popover>
|
</Popover>
|
||||||
{!capability.isHidden('edition-toolbar') && (
|
{!capability.isHidden('edition-toolbar') && model?.isMapLoadded() && (
|
||||||
<Toolbar
|
<Toolbar
|
||||||
configurations={toolbarConfiguration.current}
|
configurations={buildEditorPanelConfig(model)}
|
||||||
rerender={toolbarsRerenderSwitch}
|
rerender={toolbarsRerenderSwitch}
|
||||||
></Toolbar>
|
></Toolbar>
|
||||||
)}
|
)}
|
||||||
|
@ -57,13 +57,8 @@ export type ToolbarActionType = 'export' | 'publish' | 'history' | 'print' | 'sh
|
|||||||
* @param designer designer to aply changes
|
* @param designer designer to aply changes
|
||||||
* @returns configuration for @wisemapping/editor priAppbarmary toolbar
|
* @returns configuration for @wisemapping/editor priAppbarmary toolbar
|
||||||
*/
|
*/
|
||||||
export function buildToolbarConfig(designer: Designer): ActionConfig[] {
|
export function buildEditorPanelConfig(model: Editor): ActionConfig[] {
|
||||||
if (!designer) return [];
|
const toolbarValueModelBuilder = new NodePropertyValueModelBuilder(model.getDesigner());
|
||||||
|
|
||||||
/**
|
|
||||||
* model builder
|
|
||||||
*/
|
|
||||||
const toolbarValueModelBuilder = new NodePropertyValueModelBuilder(designer);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* submenu to manipulate node color and shape
|
* submenu to manipulate node color and shape
|
||||||
|
Loading…
Reference in New Issue
Block a user