From 288dd70df51f6289b1c6228002540833f2934708 Mon Sep 17 00:00:00 2001 From: Mimsiecke-gs Date: Tue, 15 Apr 2025 14:47:55 +0200 Subject: [PATCH 1/2] Hide Toolbar if config set --- src/components/modules/toolbar/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/modules/toolbar/index.ts b/src/components/modules/toolbar/index.ts index 3098c6aba..867400aa1 100644 --- a/src/components/modules/toolbar/index.ts +++ b/src/components/modules/toolbar/index.ts @@ -636,6 +636,13 @@ export default class Toolbar extends Module { * */ private drawUI(): void { + /** + * If Toolbar should be hidden, do nothing + */ + if (this.config.hideToolbar === true) { + return; + } + /** * Make BlockSettings Panel */ From 9b36ae20a780ad39e3853dd61839614cd3c600db Mon Sep 17 00:00:00 2001 From: Mimsiecke-gs Date: Wed, 16 Apr 2025 08:58:17 +0200 Subject: [PATCH 2/2] Bugfix --- src/components/modules/toolbar/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/modules/toolbar/index.ts b/src/components/modules/toolbar/index.ts index 867400aa1..b126950ab 100644 --- a/src/components/modules/toolbar/index.ts +++ b/src/components/modules/toolbar/index.ts @@ -227,7 +227,7 @@ export default class Toolbar extends Module { * @param {boolean} readOnlyEnabled - read-only mode */ public toggleReadOnly(readOnlyEnabled: boolean): void { - if (!readOnlyEnabled) { + if (!readOnlyEnabled && this.config.hideToolbar !== true) { window.requestIdleCallback(() => { this.drawUI(); this.enableModuleBindings(); @@ -245,6 +245,13 @@ export default class Toolbar extends Module { * @param block - block to move Toolbar near it */ public moveAndOpen(block: Block = this.Editor.BlockManager.currentBlock): void { + /** + * If Toolbar should not get initialized, do nothing + */ + if (this.Editor.ReadOnly.isEnabled || this.config.hideToolbar === true) { + return; + } + /** * Some UI elements creates inside requestIdleCallback, so the can be not ready yet */ @@ -636,13 +643,6 @@ export default class Toolbar extends Module { * */ private drawUI(): void { - /** - * If Toolbar should be hidden, do nothing - */ - if (this.config.hideToolbar === true) { - return; - } - /** * Make BlockSettings Panel */