diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/FeedTree.js | 15 | ||||
-rwxr-xr-x | js/Headlines.js | 3 |
2 files changed, 17 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); } }, diff --git a/js/Headlines.js b/js/Headlines.js index 6e1901fdc..77070f815 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -561,6 +561,9 @@ define(["dojo/_base/declare"], function (declare) { $("headlines-frame").addClassName(App.isCombinedMode() ? "cdm" : "normal"); + $("headlines-frame").setAttribute("is-vfeed", + reply['headlines']['is_vfeed'] ? 1 : 0); + Article.setActive(0); try { |