@painekillers/tree-builder-viewer 1.0.1 → 1.0.2
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.
- package/package.json +2 -2
- package/viewer.js +12 -4
package/package.json
CHANGED
package/viewer.js
CHANGED
|
@@ -40,6 +40,7 @@ export default class Viewer {
|
|
|
40
40
|
#enabled = false
|
|
41
41
|
|
|
42
42
|
recurse = true
|
|
43
|
+
strategy = "First"
|
|
43
44
|
/*
|
|
44
45
|
Null: No recursion
|
|
45
46
|
False: Creates fake nodes when encountering recursion
|
|
@@ -546,7 +547,8 @@ export default class Viewer {
|
|
|
546
547
|
root.addEventListener("click", () => {
|
|
547
548
|
this.#bridge.calculateLayout(
|
|
548
549
|
result.entry.value.id,
|
|
549
|
-
this.recurse
|
|
550
|
+
this.recurse,
|
|
551
|
+
this.strategy
|
|
550
552
|
)
|
|
551
553
|
|
|
552
554
|
this.#bridge.calculateDraw(
|
|
@@ -661,8 +663,13 @@ export default class Viewer {
|
|
|
661
663
|
)
|
|
662
664
|
}
|
|
663
665
|
|
|
664
|
-
updateUi() {
|
|
665
|
-
|
|
666
|
+
updateUi(updateTheme = false) {
|
|
667
|
+
this.#uiUpdates.updateSearchResults()
|
|
668
|
+
|
|
669
|
+
if (updateTheme) {
|
|
670
|
+
this.#uiUpdates.updateThemeButtons()
|
|
671
|
+
this.#uiUpdates.updateThemeMenu()
|
|
672
|
+
}
|
|
666
673
|
}
|
|
667
674
|
|
|
668
675
|
setRoot(root) {
|
|
@@ -676,7 +683,8 @@ export default class Viewer {
|
|
|
676
683
|
|
|
677
684
|
this.#bridge.calculateLayout(
|
|
678
685
|
root,
|
|
679
|
-
this.recurse
|
|
686
|
+
this.recurse,
|
|
687
|
+
this.strategy
|
|
680
688
|
)
|
|
681
689
|
}
|
|
682
690
|
|