render charts in the direction of the scroll
Costa Tsaousis (ktsaou) committed
Jan 14, 2018 at 02:32 UTC
7462ffbc2854b9c5b6da9fcb8b96e041a219ff18
2 files changed
+7
-3
web/dashboard.js
+6
-2
@@ -2327,8 +2327,12 @@ var NETDATA = window.NETDATA || {};
2327
var idx;
2328
if(entry.intersectionRatio > 0) {
2329
idx = NETDATA.intersectionObserver.visible_targets.indexOf(state);
2330
- if(idx === -1)
2331
- NETDATA.intersectionObserver.visible_targets.push(state);
2330
+ if(idx === -1) {
2331
+ if(NETDATA.scrollUp === true)
2332
+ NETDATA.intersectionObserver.visible_targets.push(state);
2333
+ else
2334
+ NETDATA.intersectionObserver.visible_targets.unshift(state);
2335
+ }
2336
else if(state.__visibilityRatio === 0)
2337
state.log("was not visible until now, but was already in visible_targets");
2338
}
web/index.html
+1
-1
@@ -5622,6 +5622,6 @@
5622
</div>
5623
</div>
5624
<div id="hiddenDownloadLinks" style="display: none;" hidden></div>
5625
- <script type="text/javascript" src="dashboard.js?v20180113-2"></script>
5625
+ <script type="text/javascript" src="dashboard.js?v20180114-1"></script>
5626
</body>
5627
</html>