From 3d9e0c47ecb19fea4f194d3a4a81d7d931e2bc0b Mon Sep 17 00:00:00 2001 From: maTh Date: Tue, 13 Jun 2023 22:39:33 +0200 Subject: Improved: update page (#5420) * prependTitle() * do not need the "damn" in the alert * update page layout improved * release channel * i18n labels * add log messages while updating * Delete updatee.php * Update updateController.php * Update updateController.php * Update updateController.php * Update updateController.php * add getCurrentGitBranch() * Update updateController.php * state2 buttons * i18n * loading * Update feedback.php * Update feedback.php * Update feedback.php * Update extra.js * Apply suggestions from code review Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> * Update updateController.php * Update terminology * update button is now armed --------- Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Co-authored-by: Alexandre Alapetite --- p/scripts/extra.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'p/scripts/extra.js') diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 08037b1d2..8fa0a5c5c 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -261,6 +261,17 @@ function data_leave_validation(parent, excludeForm = null) { return true; } +function init_2stateButton() { + const btns = document.getElementsByClassName('btn-state1'); + Array.prototype.forEach.call(btns, function (el) { + el.addEventListener('click', function () { + const btnState2 = document.getElementById(el.dataset.state2Id); + btnState2.classList.add('show'); + this.classList.add('hide'); + }); + }); +} + function init_configuration_alert() { window.onsubmit = function (e) { window.hasSubmit = data_leave_validation(document.body, e.submitter ? e.submitter.form : null); @@ -288,6 +299,7 @@ function init_extra_afterDOM() { init_password_observers(document.body); init_select_observers(); init_configuration_alert(); + init_2stateButton(); const slider = document.getElementById('slider'); if (slider) { -- cgit v1.2.3