Fix restoration of disabled image tags

Fix the restoration inactive image tags.
This commit is contained in:
patriceac 2023-03-25 01:46:51 -07:00
parent 8bdcea202f
commit 3c5ffbdaaa

View File

@ -158,7 +158,7 @@ async function loadModifiers() {
document.dispatchEvent(new Event('loadImageModifiers')) document.dispatchEvent(new Event('loadImageModifiers'))
} }
function refreshModifiersState(newTags) { function refreshModifiersState(newTags, inactiveTags) {
// clear existing modifiers // clear existing modifiers
document.querySelector('#editor-modifiers').querySelectorAll('.modifier-card').forEach(modifierCard => { document.querySelector('#editor-modifiers').querySelectorAll('.modifier-card').forEach(modifierCard => {
const modifierName = modifierCard.querySelector('.modifier-card-label p').dataset.fullName // pick the full modifier name const modifierName = modifierCard.querySelector('.modifier-card-label p').dataset.fullName // pick the full modifier name
@ -212,7 +212,7 @@ function refreshModifiersState(newTags) {
}) })
} }
}) })
refreshTagsList() refreshTagsList(inactiveTags)
} }
function refreshInactiveTags(inactiveTags) { function refreshInactiveTags(inactiveTags) {
@ -235,7 +235,7 @@ function refreshInactiveTags(inactiveTags) {
}) })
} }
function refreshTagsList() { function refreshTagsList(inactiveTags) {
editorModifierTagsList.innerHTML = '' editorModifierTagsList.innerHTML = ''
if (activeTags.length == 0) { if (activeTags.length == 0) {
@ -267,6 +267,7 @@ function refreshTagsList() {
let brk = document.createElement('br') let brk = document.createElement('br')
brk.style.clear = 'both' brk.style.clear = 'both'
editorModifierTagsList.appendChild(brk) editorModifierTagsList.appendChild(brk)
refreshInactiveTags(inactiveTags)
document.dispatchEvent(new Event('refreshImageModifiers')) // notify plugins that the image tags have been refreshed document.dispatchEvent(new Event('refreshImageModifiers')) // notify plugins that the image tags have been refreshed
} }