Fix the image tune menu toggle state in the block editor interface (#23510)

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Hannes Küttner <kuettner.hannes@gmail.com>
This commit is contained in:
HeikoMueller
2024-08-29 09:47:01 +02:00
committed by GitHub
parent dc739a023e
commit 4903446013
3 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Fixed the image tune menu toggle state indication in the block editor interface

View File

@@ -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', () => {

View File

@@ -159,4 +159,5 @@
- FatumaA
- HZooly
- simboonlong
- HeikoMueller
- janpio