64 lines
2.0 KiB
JavaScript
64 lines
2.0 KiB
JavaScript
/*
|
|
* Public JS
|
|
*
|
|
* @author Thomas BERLOT - <contact@bt-consulting.io>
|
|
* @copyright 2017 BT Consulting
|
|
* @license http://www.apache.org/licenses/ Apache License
|
|
* International Registered Trademark & Property of BT Consulting
|
|
*/
|
|
|
|
// Main Function
|
|
var Main = function () {
|
|
// function to custom select
|
|
var runCustomElement = function () {
|
|
// check submit
|
|
var is_submit = $("#modulecontent").attr('role');
|
|
|
|
if (is_submit == 1) {
|
|
$(".list-group-item").each(function() {
|
|
if ($(this).hasClass('active')) {
|
|
$(this).removeClass("active");
|
|
}
|
|
else if ($(this).attr('href') == "#config") {
|
|
$(this).addClass("active");
|
|
}
|
|
});
|
|
$('#config').addClass("active");
|
|
$('#informations').removeClass("active");
|
|
}
|
|
if (is_submit == 2) {
|
|
$(".list-group-item").each(function() {
|
|
if ($(this).hasClass('active')) {
|
|
$(this).removeClass("active");
|
|
}
|
|
else if ($(this).attr('href') == "#options") {
|
|
$(this).addClass("active");
|
|
}
|
|
});
|
|
$('#support').addClass("active");
|
|
$('#informations').removeClass("active");
|
|
}
|
|
|
|
$('.module_confirmation').delay(10000).hide(100); // Hides 'Configuration Updated' alert after 10 seconds
|
|
|
|
// toggle panel
|
|
$(".list-group-item").on('click', function() {
|
|
var $el = $(this).parent().closest(".list-group").children(".active");
|
|
if ($el.hasClass("active")) {
|
|
$el.removeClass("active");
|
|
$(this).addClass("active");
|
|
}
|
|
});
|
|
};
|
|
return {
|
|
//main function to initiate template pages
|
|
init: function () {
|
|
runCustomElement();
|
|
}
|
|
};
|
|
}();
|
|
|
|
$(function() {
|
|
// Load functions
|
|
Main.init();
|
|
}); |