No longer displays all subpages by default, performance on tab inactive

This commit is contained in:
Danielv123 committed 2016-10-28 10:51:46 +02:00
1 parent 85274220e7
commit 09d511d0c8
2 files changed
+8 -1

No files matched your search

+5 -1
View File
@@ -51,6 +51,7 @@ function drawcontents(data) {
}
// handle the navigation buttons
currentPage = ""
function display(page) {
var pages = document.querySelector("#body").childNodes;
for(i=0;i<pages.length;i++){
@@ -60,6 +61,7 @@ function display(page) {
}
if(typeof page == "string" && document.querySelector("#" + page)) {
document.querySelector("#" + page).style.display = "block";
currentPage = page;
}
}
@@ -154,7 +156,9 @@ setInterval(function() {
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
data = JSON.parse(xmlhttp.responseText);
drawcontents(data);
if(currentPage = "storage"){
drawcontents(data);
}
// render our piechart with up to date information
// items-in-network-chart
if(piedata) {
+3
View File
@@ -16,6 +16,9 @@
#body {
margin-left:200px;
}
#body > div {
display:none;
}
#contents {
width:300px;
}