diff --git a/src/bundle/ui-dev/src/modules/content-tree/components/content-tree/content.tree.js b/src/bundle/ui-dev/src/modules/content-tree/components/content-tree/content.tree.js index 35dfd8d22a..ae1944b0c4 100644 --- a/src/bundle/ui-dev/src/modules/content-tree/components/content-tree/content.tree.js +++ b/src/bundle/ui-dev/src/modules/content-tree/components/content-tree/content.tree.js @@ -89,18 +89,28 @@ export default class ContentTree extends Component { changeContainerWidth({ clientX }) { const currentPositionX = clientX; - this.setState((state) => ({ - resizedContainerWidth: state.containerWidth + (currentPositionX - state.resizeStartPositionX), - })); + this.setState( + (state) => ({ + resizedContainerWidth: state.containerWidth + (currentPositionX - state.resizeStartPositionX), + }), + () => { + document.body.dispatchEvent(new CustomEvent('ibexa-main-menu-resized')); + } + ); } toggleCollapseTree() { const width = this.checkIsTreeCollapsed() ? EXPANDED_WIDTH : COLLAPSED_WIDTH; - this.setState(() => ({ - resizedContainerWidth: width, - containerWidth: width, - })); + this.setState( + () => ({ + resizedContainerWidth: width, + containerWidth: width, + }), + () => { + document.body.dispatchEvent(new CustomEvent('ibexa-main-menu-resized')); + } + ); } addWidthChangeListener({ nativeEvent }) { @@ -117,11 +127,16 @@ export default class ContentTree extends Component { handleResizeEnd() { this.clearDocumentResizingListeners(); - this.setState((state) => ({ - resizeStartPositionX: 0, - containerWidth: state.resizedContainerWidth, - isResizing: false, - })); + this.setState( + (state) => ({ + resizeStartPositionX: 0, + containerWidth: state.resizedContainerWidth, + isResizing: false, + }), + () => { + document.body.dispatchEvent(new CustomEvent('ibexa-main-menu-resized')); + } + ); } clearDocumentResizingListeners() { @@ -134,22 +149,20 @@ export default class ContentTree extends Component { const CollapseAction = () => { const collapseAllLabel = Translator.trans(/*@Desc("Collapse all")*/ 'collapse_all', {}, 'content_tree'); - return ( -