AVE.CMS v3.28
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.2 KiB

5 years ago
var Debug = {
7 years ago
5 years ago
initialized: false,
7 years ago
5 years ago
init: function () {
5 years ago
5 years ago
if (this.initialized)
return;
7 years ago
5 years ago
this.initialized = true;
7 years ago
5 years ago
this.build();
this.events();
},
build: function () {
5 years ago
//
5 years ago
},
events: function () {
this.debugButton();
this.debugTabs();
},
debugButton: function () {
$('#debug_btn').on('click', function(event) {
event.preventDefault();
5 years ago
let $bar = $('#debug_bar');
5 years ago
5 years ago
if ($bar.css('display') === 'none') {
5 years ago
$(document.body).css('overflow', 'hidden');
$bar.show();
} else {
$(document.body).css('overflow', 'inherit');
$bar.hide();
}
5 years ago
Debug.debugStorage();
5 years ago
});
},
5 years ago
5 years ago
debugTabs: function () {
$('.debug_tabs > li').on('click', function(event) {
event.preventDefault();
$('.debug_tabs > li').removeClass('selected');
$('.debug_tab').hide();
$(this).addClass('selected');
$('#' + this.id + '-cont').show();
5 years ago
localStorage.setItem('__debug_bar', this.id);
5 years ago
});
},
5 years ago
debugStorage: function () {
let localValue = localStorage.getItem('__debug_bar');
if (localValue !== '') {
5 years ago
5 years ago
let tab = $('.debug_tabs > li#' + localValue);
5 years ago
if (tab.length > 0) {
tab.click();
}
5 years ago
}
}
5 years ago
};
7 years ago
5 years ago
$(document).ready(function() {
Debug.init();
});