diff --git a/src/lib/components/MediaBoxWrapper.ts b/src/lib/components/MediaBoxWrapper.ts index e25b62f..cc8ac2a 100644 --- a/src/lib/components/MediaBoxWrapper.ts +++ b/src/lib/components/MediaBoxWrapper.ts @@ -90,5 +90,10 @@ export function calculateMediaBoxesPositions(mediaBoxesList: NodeListOf) { @@ -74,6 +101,11 @@ export class TagsListBlock extends BaseComponent { } } + #onToggleGroupingClicked(event: Event) { + event.preventDefault(); + void this.#tagSettings.setGroupSeparation(!this.#shouldDisplaySeparation); + } + #handleTagGroupChanges(tagGroup: TagGroup) { const groupId = tagGroup.id; const processedGroup = this.#separatedGroups.get(groupId); @@ -181,6 +213,9 @@ export class TagsListBlock extends BaseComponent { static #orderCssVariableForGroup(groupId: string): string { return `--ta-order-${groupId}`; } + + static #iconGroupingDisabled = 'fa-folder'; + static #iconGroupingEnabled = 'fa-folder-tree'; } export function initializeAllTagsLists() { @@ -196,6 +231,13 @@ export function initializeAllTagsLists() { export function watchForUpdatedTagLists() { on(document, EVENT_FORM_EDITOR_UPDATED, event => { - event.detail.closest('#image_tags_and_source') + const tagsListElement = event.detail.closest('#image_tags_and_source'); + + if (!tagsListElement || getComponent(tagsListElement)) { + return; + } + + new TagsListBlock(tagsListElement) + .initialize(); }); }