Fire event when random seed is toggled by dnd.js

This is to let plugins know that the state of the random seed toggle was programmatically changed by dnd.js. No change for regular UI.
This commit is contained in:
patriceac 2023-03-25 02:47:05 -07:00 committed by GitHub
parent 55da2988b3
commit 1c2e353fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,11 +92,13 @@ const TASK_MAPPING = {
setUI: (seed) => {
if (!seed) {
randomSeedField.checked = true
randomSeedField.dispatchEvent(new Event('change')) // let plugins know that the state of the random seed toggle changed
seedField.disabled = true
seedField.value = 0
return
}
randomSeedField.checked = false
randomSeedField.dispatchEvent(new Event('change')) // let plugins know that the state of the random seed toggle changed
seedField.disabled = false
seedField.value = seed
},