From e0e017ceaf6d393e78515ff26639940e278a3c41 Mon Sep 17 00:00:00 2001 From: Alice <alice.poggioli@hotmail.fr> Date: Tue, 28 Apr 2020 15:13:53 +0200 Subject: [PATCH] fix pb on indentation --- src/scripts/coopstarter.js | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index b4d913bf..c993837f 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -225,21 +225,20 @@ function InitManagementForType() { let type_hidden_field = form.querySelectorAll('select[name="type"]'); type_hidden_field.forEach(function(select_hidden) { options_hidden = select_hidden.getElementsByTagName("option"); - for (let option_hidden of options_hidden) { - option_hidden.removeAttribute("selected"); - str = option_hidden.value - - if (str.substr(str.length - 10) == 'types/1/"}') { - - //Actually selecting the option if it is the good one - option_hidden.setAttribute("selected", "selected"); - select_hidden.setAttribute("value", option_hidden.value); + for (let option_hidden of options_hidden) { + option_hidden.removeAttribute("selected"); + str = option_hidden.value + + if (str.substr(str.length - 10) == 'types/1/"}') { + //Actually selecting the option if it is the good one + option_hidden.setAttribute("selected", "selected"); + select_hidden.setAttribute("value", option_hidden.value); + } } - } - //Trigerring a reload of the associated form - let parent_form = select_hidden.closest("sib-form"); - parent_form.component.inputChange(); - refreshPagination(); + //Trigerring a reload of the associated form + let parent_form = select_hidden.closest("sib-form"); + parent_form.component.inputChange(); + refreshPagination(); }); }); }, @@ -360,14 +359,12 @@ function manageSelectLanguage() { if (uriLanguage.substr(uriLanguage.length - 14) == 'languages/1/"}') { //Redirection with the appropriate prefixe. var redirect = "http://"+base_url+'/fr/'+pathAfterThePrefix - document.location.href = redirect - } else { + } + else { var redirect = "http://"+base_url+'/en/'+pathAfterThePrefix document.location.href = redirect - } - }) } } -- GitLab