1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:15:56 +00:00

Headlines.move: maybe glitch less when moving back to top, etc

This commit is contained in:
Andrew Dolgov
2020-05-17 16:04:31 +03:00
parent cd1f3cb8cc
commit 05a84ab778
3 changed files with 41 additions and 37 deletions

View File

@@ -33,6 +33,18 @@ define(["dojo/_base/declare"], function (declare) {
elem.scrollTop += offset;
},
isChildVisible: function(elem, ctr) {
if (!elem) return;
const ctop = ctr.scrollTop;
const cbottom = ctop + ctr.offsetHeight;
const etop = elem.offsetTop;
const ebottom = etop + elem.offsetHeight;
return etop >= ctop && ebottom <= cbottom ||
etop < ctop && ebottom > ctop || ebottom > cbottom && etop < cbottom;
},
},
constructor: function() {
window.onerror = this.Error.onWindowError;