selectFeed: scroll feed tree to selected row

This commit is contained in:
Andrew Dolgov 2019-01-27 23:31:00 +03:00
parent da35421cce
commit 3827e5b944
1 changed files with 10 additions and 1 deletions

View File

@ -270,8 +270,17 @@ 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();
const node = treeNode.rowNode;
const tree = this.domNode;
// scroll tree to selection if needed
if (node.offsetTop < tree.scrollTop || node.offsetTop > tree.scrollTop + tree.clientHeight) {
$("feedTree").scrollTop = node.offsetTop;
}
}, 0);
}
},