Config : button sélectionné après un submit

This commit is contained in:
Fred Tempez 2021-12-01 18:47:50 +01:00
parent 975d0c579d
commit 242e695ab7

View File

@ -38,6 +38,28 @@ $( document).ready(function() {
$("#SmtpAuthParam").slideUp(); $("#SmtpAuthParam").slideUp();
} }
var configLayout = getCookie("configLayout");
if (configLayout == null) {
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").show();
$("#configSetupButton").addClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
setCookie("configLayout","setup");
}
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").hide();
$("#" + configLayout + "Container" ).show();
$("#config" + capitalizeFirstLetter(configLayout) + "Button").addClass("activeButton");
// Gestion des événements // Gestion des événements
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -177,26 +199,6 @@ $( document).ready(function() {
setCookie("configLayout","network"); setCookie("configLayout","network");
}); });
var configLayout = getCookie("configLayout");
if (configLayout == null) {
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").show();
$("#configSetupButton").addClass("activeButton");
$("#configLocaleButton").removeClass("activeButton");
$("#configSocialButton").removeClass("activeButton");
$("#configConnectButton").removeClass("activeButton");
$("#configNetworkButton").removeClass("activeButton");
setCookie("configLayout","setup");
}
$("#localeContainer").hide();
$("#socialContainer").hide();
$("#connectContainer").hide();
$("#networkContainer").hide();
$("#setupContainer").hide();
$("#" + configLayout + "Container" ).show();
}); });
@ -221,3 +223,8 @@ function getCookie(name) {
} }
return null; return null;
} }
// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}