Scroll tree elements to view even if they don't have a parent element.
This commit is contained in:
parent
4694fe640a
commit
ff53c05bb2
@ -155,11 +155,6 @@ div.ov_toolbar div.ov_toolbar_button div.ov_svg_icon
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
div.ov_toolbar div.ov_toolbar_button.right
|
||||
{
|
||||
float: right;
|
||||
}
|
||||
|
||||
div.ov_toolbar div.ov_toolbar_button.selected
|
||||
{
|
||||
background: var(--ov_toolbar_selected_color);
|
||||
|
||||
@ -82,11 +82,15 @@ OV.TreeViewSingleItem = class extends OV.TreeViewItem
|
||||
if (this.selected) {
|
||||
this.mainElement.addClass ('selected');
|
||||
let parent = this.parent;
|
||||
while (parent !== null) {
|
||||
parent.ShowChildren (true, () => {
|
||||
OV.ScrollToView (this.mainElement);
|
||||
});
|
||||
parent = parent.parent;
|
||||
if (parent === null) {
|
||||
OV.ScrollToView (this.mainElement);
|
||||
} else {
|
||||
while (parent !== null) {
|
||||
parent.ShowChildren (true, () => {
|
||||
OV.ScrollToView (this.mainElement);
|
||||
});
|
||||
parent = parent.parent;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.mainElement.removeClass ('selected');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user