From 0891f85e9412e5df886e7e44518e0ad6ae418114 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 18 Jul 2023 19:50:57 +0800 Subject: [PATCH] select menus and checkboxes prompts --- static/app.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/static/app.js b/static/app.js index 955f5f2..4d686a0 100755 --- a/static/app.js +++ b/static/app.js @@ -3256,3 +3256,32 @@ function featureSavePrompt() { }, 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(); + }); + }); +}