Skip to content

Commit

Permalink
Merge pull request #6363 from akatsoulas/enable-update-on-select
Browse files Browse the repository at this point in the history
Enable Update button on selection
  • Loading branch information
akatsoulas authored Nov 20, 2024
2 parents ea38b72 + 297f3a3 commit d6242fa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion kitsune/sumo/static/sumo/js/flagit.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ document.addEventListener('DOMContentLoaded', () => {
}

function initializeDropdownsAndTags() {
document.querySelectorAll('.topic-dropdown, .tag-select').forEach(dropdown => {
document.querySelectorAll('.topic-dropdown, .tag-select, select[name="status"]').forEach(dropdown => {
const questionId = dropdown.dataset.questionId;

dropdown.addEventListener('change', async function () {
Expand Down Expand Up @@ -111,6 +111,18 @@ document.addEventListener('DOMContentLoaded', () => {
}
});
}

if (dropdown.name === 'status') {
dropdown.addEventListener('change', function () {
const form = this.closest('form');
const updateButton = form.querySelector('input[type="submit"]');
if (this.value) {
updateButton.disabled = false;
} else {
updateButton.disabled = true;
}
});
}
});
}

Expand Down

0 comments on commit d6242fa

Please sign in to comment.