diff options
Diffstat (limited to 'js/FeedTree.js')
-rwxr-xr-x | js/FeedTree.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/js/FeedTree.js b/js/FeedTree.js index 6b6189a4a..f89486332 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -270,8 +270,21 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"], this.focusNode(treeNode); // focus headlines to route key events there - setTimeout(function() { + setTimeout(() => { $("headlines-frame").focus(); + + if (treeNode) { + const node = treeNode.rowNode; + const tree = this.domNode; + + if (node && tree) { + // scroll tree to selection if needed + if (node.offsetTop < tree.scrollTop || node.offsetTop > tree.scrollTop + tree.clientHeight) { + $("feedTree").scrollTop = node.offsetTop; + } + } + } + }, 0); } }, |