select menus and checkboxes prompts

This commit is contained in:
Justin 2023-07-18 19:50:57 +08:00 committed by GitHub
parent 8f15e8201c
commit 0891f85e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3256,3 +3256,32 @@ function featureSavePrompt() {
}, 3000); }, 3000);
} }
const pageIDs = ['Page1', 'Page2', 'Page3', 'Page4', 'Page5', 'Page6', 'Page7', 'Page8', 'Page9', 'Page10', 'Page11', 'Page12', 'Page13',
'Page14', 'Page15', 'Page16', 'Page17', 'Page18', 'Page19'];
for (const pageID of pageIDs) {
// Select the parent div
const parentDiv = document.getElementById(pageID);
// Add event listeners to select menus
const excludedIds = ['base-select', 'quote-select', 'commodities-items', 'indices-items', 'inputTransition73',
'inputTransition83', 'inputTransition93', 'inputTransition103', 'inputTransition2222', 'jokes-categories'];
const selectMenus = parentDiv.querySelectorAll('select');
selectMenus.forEach(selectMenu => {
const id = selectMenu.id;
if (!excludedIds.includes(id)) {
selectMenu.addEventListener('change', function(event) {
displaySavePrompt2();
});
}
});
// Add event listeners to input checkboxes
const inputForms = parentDiv.querySelectorAll('input[type="checkbox"]');
inputForms.forEach(inputForm => {
inputForm.addEventListener('input', function(event) {
displaySavePrompt2();
});
});
}