Module plugin bug présélection des boutons

This commit is contained in:
Fred Tempez 2022-09-19 17:01:39 +02:00
parent 32048ffa12
commit fdfaee71db
2 changed files with 17 additions and 16 deletions

View File

@ -13,15 +13,16 @@
$(document).ready(function () {
var configLayout = getCookie("pluginLayout");
if (configLayout == null) {
configLayout = "module";
var pluginLayout = getCookie("pluginLayout");
if (pluginLayout == null) {
pluginLayout = "module";
setCookie("pluginLayout", "module");
}
console.log(pluginLayout);
$("#moduleContainer").hide();
$("#dataContainer").hide();
$("#" + configLayout + "Container").show();
$("#config" + capitalizeFirstLetter(pluginLayout) + "Button").addClass("activeButton");
$("#" + pluginLayout + "Container").show();
$("#plugin" + capitalizeFirstLetter(pluginLayout) + "Button").addClass("activeButton");
});
@ -51,18 +52,18 @@ $(".moduleDelete").on("click", function() {
// Sélecteur de fonctions
$("#configModuleButton").on("click", function () {
$("#pluginModuleButton").on("click", function () {
$("#dataContainer").hide();
$("#moduleContainer").show();
$("#configModuleButton").addClass("activeButton");
$("#configDataButton").removeClass("activeButton");
$("#pluginModuleButton").addClass("activeButton");
$("#pluginDataButton").removeClass("activeButton");
setCookie("pluginLayout", "module");
});
$("#configDataButton").on("click", function () {
$("#pluginDataButton").on("click", function () {
$("#moduleContainer").hide();
$("#dataContainer").show();
$("#configModuleButton").removeClass("activeButton");
$("#configDataButton").addClass("activeButton");
$("#pluginModuleButton").removeClass("activeButton");
$("#pluginDataButton").addClass("activeButton");
setCookie("pluginLayout", "data");
});

View File

@ -7,7 +7,7 @@
]); ?>
</div>
<div class="col1">
<?php echo template::button('configModulesHelp', [
<?php echo template::button('pluginHelp', [
'href' => 'https://doc.zwiicms.fr/gestion-des-modules',
'target' => '_blank',
'value' => template::ico('help'),
@ -16,14 +16,14 @@
]); ?>
</div>
<div class="col1 offset8">
<?php echo template::button('configModulesStore', [
<?php echo template::button('pluginModulesStore', [
'href' => helper::baseUrl() . 'plugin/store',
'value' => template::ico('shopping-basket'),
'help' => 'Installer depuis le catalogue en ligne'
]); ?>
</div>
<div class="col1">
<?php echo template::button('configStoreUpload', [
<?php echo template::button('pluginStoreUpload', [
'href' => helper::baseUrl() . 'plugin/upload',
'value' => template::ico('file-archive'),
'help' => 'Installer depuis une archive'
@ -31,11 +31,11 @@
</div>
</div>
<div class="tab">
<?php echo template::button('configModuleButton', [
<?php echo template::button('pluginModuleButton', [
'value' => 'Modules installés',
'class' => ' buttonTab'
]); ?>
<?php echo template::button('configDataButton', [
<?php echo template::button('pluginDataButton', [
'value' => 'Données des modules',
'class' => 'buttonTab'
]); ?>