@cryptotaxi247 / netdata-1 / commits / c5393c295

remember thumbs scroll position when coming back from the main chart

Costa Tsaousis (ktsaou) committed Apr 2, 2014 at 01:37 UTC c5393c2951a0469014c529263486ab76dbb6e7a2
1 file changed +6
web/index.html
+6
@@ -328,8 +328,12 @@
328 resizeCharts();
329 };
330
331 + var thumbsScrollPosition = null;
332 function showMainGraph() {
333 if(!mainchart) return;
334 +
335 + thumbsScrollPosition = window.pageYOffset;
336 +
337 mode = MODE_MAIN;
338
339 document.getElementById('maingraph_container').style.display = 'block';
@@ -344,6 +348,8 @@
348 document.getElementById('maingraph_container').style.display = 'none';
349 document.getElementById('thumbgraphs_container').style.display = 'block';
350
351 + if(thumbsScrollPosition) window.scrollTo(0, thumbsScrollPosition);
352 +
353 if(mainchart) {
354 if(mainchart.chart) mainchart.chart.clearChart();
355 mainchart = null;