aboutsummaryrefslogtreecommitdiff
path: root/p/scripts/extra.js
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2023-06-13 22:39:33 +0200
committerGravatar GitHub <noreply@github.com> 2023-06-13 22:39:33 +0200
commit3d9e0c47ecb19fea4f194d3a4a81d7d931e2bc0b (patch)
tree52ca8a7131822807d5cd1e7188b42100594d2988 /p/scripts/extra.js
parent67130bca3aa0a8d225c43df57a08cf8c81995136 (diff)
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 <alexandre@alapetite.fr>
Diffstat (limited to 'p/scripts/extra.js')
-rw-r--r--p/scripts/extra.js12
1 files changed, 12 insertions, 0 deletions
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) {