diff --git a/.changeset/rare-pumpkins-decide.md b/.changeset/rare-pumpkins-decide.md new file mode 100644 index 0000000000..a120af598b --- /dev/null +++ b/.changeset/rare-pumpkins-decide.md @@ -0,0 +1,5 @@ +--- +'@directus/app': patch +--- + +Fixed the image tune menu toggle state indication in the block editor interface diff --git a/app/src/interfaces/input-block-editor/plugins.ts b/app/src/interfaces/input-block-editor/plugins.ts index c1d5a2111a..e45faa5bea 100644 --- a/app/src/interfaces/input-block-editor/plugins.ts +++ b/app/src/interfaces/input-block-editor/plugins.ts @@ -179,7 +179,7 @@ export class ImageTool extends BaseImageTool { bus.emit({ type: 'open-url', payload: this.data.file.fileURL }); }, }, - ...ImageTool.tunes, + ...BaseImageTool.tunes, ]; const wrapperElement = document.createElement('div'); @@ -201,6 +201,10 @@ export class ImageTool extends BaseImageTool { titleElement.innerHTML = tune.title; tuneElement.appendChild(titleElement); + if (tune.toggle && tune.name && this._data[tune.name]) { + tuneElement.classList.add('ce-popover-item--active'); + } + if (tune.onActivate) tuneElement.addEventListener('click', tune.onActivate); else if (tune.toggle) tuneElement.addEventListener('click', () => { diff --git a/contributors.yml b/contributors.yml index ed204df649..608b9c30d9 100644 --- a/contributors.yml +++ b/contributors.yml @@ -159,4 +159,5 @@ - FatumaA - HZooly - simboonlong +- HeikoMueller - janpio