1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-21 10:31:28 +00:00

feedTree: amend previous to check that nodes are actually there

This commit is contained in:
Andrew Dolgov
2019-01-28 18:48:56 +03:00
parent 277759221c
commit 42e0c7a420

View File

@@ -276,9 +276,11 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
const node = treeNode.rowNode; const node = treeNode.rowNode;
const tree = this.domNode; const tree = this.domNode;
// scroll tree to selection if needed if (node && tree) {
if (node.offsetTop < tree.scrollTop || node.offsetTop > tree.scrollTop + tree.clientHeight) { // scroll tree to selection if needed
$("feedTree").scrollTop = node.offsetTop; if (node.offsetTop < tree.scrollTop || node.offsetTop > tree.scrollTop + tree.clientHeight) {
$("feedTree").scrollTop = node.offsetTop;
}
} }
}, 0); }, 0);