@limble/limble-tree 1.0.0-beta.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -862,7 +862,6 @@ class TreeBranch {
862
862
  assert(parentBranchesContainer !== undefined);
863
863
  this.branchController = new BranchController(this, parentBranchesContainer);
864
864
  const hostView = this.branchController.getHostView();
865
- this.setIndentation(parent);
866
865
  if (parent instanceof TreeBranch &&
867
866
  parent.branchOptions.defaultCollapsed === true) {
868
867
  treeCollapser.storePrecollapsedNode(parent, this);
@@ -876,8 +875,9 @@ class TreeBranch {
876
875
  child: this,
877
876
  index: this._parent.branches().length
878
877
  }));
879
- this.detectChanges();
878
+ this.setIndentation();
880
879
  }
880
+ this.detectChanges();
881
881
  }
882
882
  /** @returns All child branches as an array of TreeBranch instances, in order. */
883
883
  branches() {
@@ -1246,10 +1246,14 @@ class TreeBranch {
1246
1246
  this.detachedView.reattach();
1247
1247
  container.insert(this.detachedView, index);
1248
1248
  this.detachedView = null;
1249
+ this.setIndentation();
1249
1250
  }
1250
- setIndentation(parent) {
1251
- const root = parent.root();
1252
- assert(root !== undefined);
1251
+ setIndentation() {
1252
+ assert(this._parent !== undefined);
1253
+ const root = this._parent.root();
1254
+ if (root === undefined) {
1255
+ return;
1256
+ }
1253
1257
  const options = config.getConfig(root);
1254
1258
  const branchesContainerEl = this.branchController
1255
1259
  .getNativeElement()