diff options
author | Renato Botelho <renato@netgate.com> | 2017-02-10 14:10:05 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-02-10 14:15:36 -0200 |
commit | a166a21265eeef61eff00b53b5ca389f9ec51518 (patch) | |
tree | 4a76e7949bf7598bfee510bccb7a336d4c3356a9 /src/usr | |
parent | c5ae2b4df3e4dec87757ae4f8e7e39931e11551f (diff) | |
download | pfsense-a166a21265eeef61eff00b53b5ca389f9ec51518.zip pfsense-a166a21265eeef61eff00b53b5ca389f9ec51518.tar.gz |
Fix #7157
trafficgraph: Don't update the on screen visual graph while invisible,
which avoids creating a large queue of pending timer objects waiting
for the next requestAnimationFrame to happen.
Submitted by: PiBa-NL at https://github.com/pfsense/pfsense/pull/3450
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/js/traffic-graphs.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/usr/local/www/js/traffic-graphs.js b/src/usr/local/www/js/traffic-graphs.js index 0dd7b67..79e3927 100644 --- a/src/usr/local/www/js/traffic-graphs.js +++ b/src/usr/local/www/js/traffic-graphs.js @@ -90,7 +90,6 @@ function draw_graph(refreshInterval, then, backgroundupdate) { charts[value].interactiveLayer.tooltip.contentGenerator(function(data) { var units = 'b/s'; - console.log(localStorage.getItem('size')); if(localStorage.getItem('size') === "1") { units = 'B/s' } @@ -197,7 +196,15 @@ function draw_graph(refreshInterval, then, backgroundupdate) { myData[key][0].values.shift(); myData[key][1].values.shift(); - charts[key].update(); + if (!Visibility.hidden()) { + /* + * don't draw graph when tab is not + * visible. This also prevents lots of + * timers stacking up waiting for a + * frame update. + */ + charts[key].update(); + } }); |