mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 07:04:53 +09:00
No longer displays all subpages by default, performance on tab inactive
This commit is contained in:
1 parent
85274220e7
commit
09d511d0c8
2 files changed
+8
-1
No files matched your search
+5
-1
@@ -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) {
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#body {
|
||||
margin-left:200px;
|
||||
}
|
||||
#body > div {
|
||||
display:none;
|
||||
}
|
||||
#contents {
|
||||
width:300px;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user