From 95b7d0decfd7e222ee2a43186da469b30f5e5dfe Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 13 Nov 2016 22:40:34 +0000 Subject: [PATCH] Immediate invoking or on interval instead --- lib/ice-coder.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index b37c4f0..e9c153a 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -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);