mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 15:47:55 +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 {
|
||||
buildAppBarConfig,
|
||||
buildToolbarConfig,
|
||||
buildEditorPanelConfig,
|
||||
buildZoomToolbarConfig,
|
||||
} from './toolbar/toolbarConfigBuilder';
|
||||
|
||||
@ -62,12 +62,6 @@ const Editor = ({
|
||||
setModel(model);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (model) {
|
||||
toolbarConfiguration.current = buildToolbarConfig(model.getDesigner());
|
||||
}
|
||||
}, [model]);
|
||||
|
||||
useEffect(() => {
|
||||
if (options.enableKeyboardEvents) {
|
||||
DesignerKeyboard.resume();
|
||||
@ -108,9 +102,9 @@ const Editor = ({
|
||||
>
|
||||
{widgetManager.getEditorContent()}
|
||||
</Popover>
|
||||
{!capability.isHidden('edition-toolbar') && (
|
||||
{!capability.isHidden('edition-toolbar') && model?.isMapLoadded() && (
|
||||
<Toolbar
|
||||
configurations={toolbarConfiguration.current}
|
||||
configurations={buildEditorPanelConfig(model)}
|
||||
rerender={toolbarsRerenderSwitch}
|
||||
></Toolbar>
|
||||
)}
|
||||
|
@ -57,13 +57,8 @@ export type ToolbarActionType = 'export' | 'publish' | 'history' | 'print' | 'sh
|
||||
* @param designer designer to aply changes
|
||||
* @returns configuration for @wisemapping/editor priAppbarmary toolbar
|
||||
*/
|
||||
export function buildToolbarConfig(designer: Designer): ActionConfig[] {
|
||||
if (!designer) return [];
|
||||
|
||||
/**
|
||||
* model builder
|
||||
*/
|
||||
const toolbarValueModelBuilder = new NodePropertyValueModelBuilder(designer);
|
||||
export function buildEditorPanelConfig(model: Editor): ActionConfig[] {
|
||||
const toolbarValueModelBuilder = new NodePropertyValueModelBuilder(model.getDesigner());
|
||||
|
||||
/**
|
||||
* submenu to manipulate node color and shape
|
||||
|
Loading…
Reference in New Issue
Block a user