Immediate invoking or on interval instead

This commit is contained in:
Matt Pass
2016-11-13 22:40:34 +00:00
parent abcedf9dc5
commit 95b7d0decf

View File

@@ -542,13 +542,19 @@ var ICEcoder = {
}
// Update the list of functions and classes
top.ICEcoder.updateFunctionClassList();
// Update the minimap nav after 1 sec of inactivity
// Update the minimap nav
if ("undefined" != typeof top.doMiniNav) {
clearTimeout(top.doMiniNav);
}
top.doMiniNav = setTimeout(function() {
if (top.ICEcoder.loadingFile) {
// Load event means set it straight away
top.ICEcoder.setMinimap();
},top.ICEcoder.loadingFile ? 0 : 1000);
} else {
// Update event means do it after 1 sec of inactivity
top.doMiniNav = setTimeout(function() {
top.ICEcoder.setMinimap();
},1000);
}
filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
if (filepath) {
filename = filepath.substr(filepath.lastIndexOf("/")+1);