app/assets/javascripts/blacklight/hierarchy/blacklight_hierarchy_controller.js in blacklight-hierarchy-6.2.0 vs app/assets/javascripts/blacklight/hierarchy/blacklight_hierarchy_controller.js in blacklight-hierarchy-6.2.1
- old
+ new
@@ -2,9 +2,16 @@
export default class extends Controller {
static targets = [ "list" ]
connect() {
this.element.classList.add("twiddle")
+
+ // If a child facet-value is selected, then expand the node
+ if (this.element.querySelector(':scope > span.selected')) {
+ this.element.classList.add('twiddle-open')
+ this.element.querySelectorAll(':scope > .collapse')
+ .forEach((collapsable) => collapsable.classList.add('show'))
+ }
}
toggle() {
this.element.classList.toggle("twiddle-open")
}