FCLT#59401 Single page als gebouwdashboard - optimalisatie gebruikte plug-ins
svn path=/Website/trunk/; revision=45845
This commit is contained in:
27
APPL/Consoles/fluid-mode-switch.js
Normal file
27
APPL/Consoles/fluid-mode-switch.js
Normal file
@@ -0,0 +1,27 @@
|
||||
(function() {
|
||||
var fluidSwitch = document.getElementById("fluidSwitch");
|
||||
if (fluidSwitch) {
|
||||
initFluidTheme();
|
||||
fluidSwitch.addEventListener("change", function(event) {
|
||||
resetFluidTheme();
|
||||
});
|
||||
function initFluidTheme() {
|
||||
var fluidThemeSelected =
|
||||
localStorage.getItem("fluidSwitch") !== null &&
|
||||
localStorage.getItem("fluidSwitch") === "on";
|
||||
fluidSwitch.checked = fluidThemeSelected;
|
||||
fluidThemeSelected
|
||||
? $("div.container").removeClass("container").addClass("container-fluid")
|
||||
: $("div.container-fluid").removeClass("container-fluid").addClass("container");
|
||||
}
|
||||
function resetFluidTheme() {
|
||||
if (fluidSwitch.checked) {
|
||||
$("div.container").removeClass("container").addClass("container-fluid");
|
||||
localStorage.setItem("fluidSwitch", "on");
|
||||
} else {
|
||||
$("div.container-fluid").removeClass("container-fluid").addClass("container");
|
||||
localStorage.setItem("fluidSwitch", "off");
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user