Add option for default tree expanded depth.

This commit is contained in:
Sj-Si 2024-05-03 19:20:47 -04:00
parent b497467436
commit fbefe7f4fe
3 changed files with 22 additions and 14 deletions

View file

@ -68,7 +68,8 @@ class ExtraNetworksClusterize extends Clusterize {
await this.initData();
// can't use super class' sort since it relies on setup being run first.
// but we do need to make sure to sort the new data before continuing.
await this.setMaxItems(Object.keys(this.data_obj).length);
const max_items = Object.keys(this.data_obj).filter(k => this.data_obj[k].visible).length;
await this.setMaxItems(max_items);
await this.refresh(true);
await this.options.callbacks.sortData();
}