hyperion.ng/assets/webconfig/js/lib/sb-admin-2.js
b1rdhous3 c207828069 WebUI: Several File adjustments (#195)
* Example JSON Form Example with General setting

I have created a new Category "General" with several Settings for
Hyperion.
For now the Submit Button only console.log's the values.

Known Bug: For some reason it seems to do not load the bootstrap
correctly or maybe the Lib isn't compatible with the newest version of
bootstrap.

* Reorganize files
2016-08-23 19:42:16 +02:00

45 lines
1.3 KiB
JavaScript

$(function() {
$('#side-menu').metisMenu();
});
//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() {
var topOffset = 50;
var 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');
}
var 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;
// }).addClass('active').parent().parent().addClass('in').parent();
var element = $('ul.nav a').filter(function() {
return this.href == url;
}).addClass('active').parent();
while(true){
if (element.is('li')){
element = element.parent().addClass('in').parent();
} else {
break;
}
}
});