|
|
@@ -3,6 +3,56 @@ require('jquery-slimscroll');
|
|
|
|
|
|
require('./waves');
|
|
|
|
|
|
+let aaSettings = undefined;
|
|
|
+
|
|
|
+function loadSettings() {
|
|
|
+ const settingsStr = sessionStorage.getItem('agile-admin') || '{}';
|
|
|
+ aaSettings = JSON.parse(settingsStr);
|
|
|
+}
|
|
|
+
|
|
|
+function saveSettings() {
|
|
|
+ sessionStorage.setItem('agile-admin', JSON.stringify(aaSettings));
|
|
|
+}
|
|
|
+
|
|
|
+// load settings from sessionStorage
|
|
|
+loadSettings();
|
|
|
+
|
|
|
+//Loads the correct sidebar on window load,
|
|
|
+//collapses the sidebar on window resize.
|
|
|
+// Sets the min-height of #page-wrapper to window size
|
|
|
+$(window).on("load resize", function () {
|
|
|
+ let topOffset = 60;
|
|
|
+ const width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
|
|
|
+ if (width < 768) {
|
|
|
+ $('div.navbar-collapse').addClass('collapse');
|
|
|
+ topOffset = 100; // 2-row-menu
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $('div.navbar-collapse').removeClass('collapse');
|
|
|
+ }
|
|
|
+ let height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
|
|
|
+ height = height - topOffset;
|
|
|
+ if (height < 1) height = 1;
|
|
|
+ if (height > topOffset) {
|
|
|
+ $("#page-wrapper").css("min-height", (height) + "px");
|
|
|
+ }
|
|
|
+});
|
|
|
+// This is for resize window
|
|
|
+$(window).on("load resize", function () {
|
|
|
+ const width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
|
|
|
+ if (!aaSettings.isSidebarOpened || width < 1170) {
|
|
|
+ $('body').addClass('content-wrapper');
|
|
|
+ $(".open-close i").addClass('ti-menu');
|
|
|
+ $(".open-close i").removeClass('ti-angle-left');
|
|
|
+ $(".sidebar-nav, .slimScrollDiv").css("overflow-x", "visible").parent().css("overflow", "visible");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $('body').removeClass('content-wrapper');
|
|
|
+ $(".open-close i").addClass('ti-angle-left');
|
|
|
+ $(".open-close i").removeClass('ti-menu');
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
$(document).ready(function () {
|
|
|
$(function () {
|
|
|
$(".preloader").fadeOut();
|
|
|
@@ -35,58 +85,21 @@ $(document).ready(function () {
|
|
|
$('.fxsdr').attr('checked', false);
|
|
|
}
|
|
|
});
|
|
|
- //Loads the correct sidebar on window load,
|
|
|
- //collapses the sidebar on window resize.
|
|
|
- // Sets the min-height of #page-wrapper to window size
|
|
|
$(function () {
|
|
|
- $(window).bind("load resize", function () {
|
|
|
- let topOffset = 60;
|
|
|
- const width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
|
|
|
- if (width < 768) {
|
|
|
- $('div.navbar-collapse').addClass('collapse');
|
|
|
- topOffset = 100; // 2-row-menu
|
|
|
- }
|
|
|
- else {
|
|
|
- $('div.navbar-collapse').removeClass('collapse');
|
|
|
- }
|
|
|
- let height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
|
|
|
- height = height - topOffset;
|
|
|
- if (height < 1) height = 1;
|
|
|
- if (height > topOffset) {
|
|
|
- $("#page-wrapper").css("min-height", (height) + "px");
|
|
|
- }
|
|
|
- });
|
|
|
- var url = window.location;
|
|
|
- var element = $('ul.nav a').filter(function () {
|
|
|
- return this.href == url || url.href.indexOf(this.href) == 0;
|
|
|
- }).addClass('active').parent().parent().addClass('in').parent();
|
|
|
- if (element.is('li')) {
|
|
|
- element.addClass('active');
|
|
|
- }
|
|
|
- });
|
|
|
- // This is for resize window
|
|
|
- $(function () {
|
|
|
- $(window).bind("load resize", function () {
|
|
|
- const width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
|
|
|
- if (width < 1170) {
|
|
|
- $('body').addClass('content-wrapper');
|
|
|
- $(".open-close i").addClass('ti-menu');
|
|
|
- $(".open-close i").removeClass('ti-angle-left');
|
|
|
- $(".sidebar-nav, .slimScrollDiv").css("overflow-x", "visible").parent().css("overflow", "visible");
|
|
|
- $(".logo span").hide();
|
|
|
- }
|
|
|
- else {
|
|
|
- $('body').removeClass('content-wrapper');
|
|
|
- $(".open-close i").addClass('ti-angle-left');
|
|
|
- $(".open-close i").removeClass('ti-menu');
|
|
|
- $(".logo span").show();
|
|
|
- }
|
|
|
- });
|
|
|
+ var url = window.location;
|
|
|
+ var element = $('ul.nav a').filter(function () {
|
|
|
+ return this.href == url || url.href.indexOf(this.href) == 0;
|
|
|
+ }).addClass('active').parent().parent().addClass('in').parent();
|
|
|
+ if (element.is('li')) {
|
|
|
+ element.addClass('active');
|
|
|
+ }
|
|
|
});
|
|
|
// This is for click on open close button
|
|
|
// Sidebar open close
|
|
|
$(".open-close").on('click', function () {
|
|
|
if ($("body").hasClass("content-wrapper")) {
|
|
|
+ aaSettings.isSidebarOpened = true;
|
|
|
+ saveSettings();
|
|
|
$("body").trigger("resize");
|
|
|
$(".sidebar-nav, .slimScrollDiv").css("overflow", "hidden").parent().css("overflow", "visible");
|
|
|
$("body").removeClass("content-wrapper");
|
|
|
@@ -95,6 +108,8 @@ $(document).ready(function () {
|
|
|
$(".logo span").show();
|
|
|
}
|
|
|
else {
|
|
|
+ aaSettings.isSidebarOpened = false;
|
|
|
+ saveSettings();
|
|
|
$("body").trigger("resize");
|
|
|
$(".sidebar-nav, .slimScrollDiv").css("overflow-x", "visible").parent().css("overflow", "visible");
|
|
|
$("body").addClass("content-wrapper");
|
|
|
@@ -103,6 +118,7 @@ $(document).ready(function () {
|
|
|
$(".logo span").hide();
|
|
|
}
|
|
|
});
|
|
|
+ /*
|
|
|
// Collapse Panels
|
|
|
(function ($, window, document) {
|
|
|
var panelSelector = '[data-perform="panel-collapse"]';
|
|
|
@@ -148,6 +164,7 @@ $(document).ready(function () {
|
|
|
}
|
|
|
});
|
|
|
}(jQuery, window, document));
|
|
|
+ */
|
|
|
//tooltip
|
|
|
$(function () {
|
|
|
$('[data-toggle="tooltip"]').tooltip()
|