зеркало из https://github.com/mozilla/kitsune.git
Merge pull request #6363 from akatsoulas/enable-update-on-select
Enable Update button on selection
This commit is contained in:
Коммит
d6242fa632
|
@ -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 () {
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче