blacklight-hierarchy 6.2.1 → 6.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fca18535296b68bd479804bc6b7ea6f8dc01672308b66cbfa40ac5ef976c18c
4
- data.tar.gz: fc1c3126b371db5ff9a06af2a6595ea28b00c09f94904adf7ed012a194c60814
3
+ metadata.gz: 197182e820d76bcf3b9a8465f0067e628ca82227be36780b984ea30bbea06f74
4
+ data.tar.gz: 7e66323965a18cd418d3f061666c4b91a0efbc572680d10991c446cfa17dfd35
5
5
  SHA512:
6
- metadata.gz: ad00c8daa2fa49e1e199bb0a4d22ffd2edacf2fdced57944c56dbc975681b89e3c5e9106a8d9e8099ce51271a4209862b3cab42ce637917f7bb51b6887036ce6
7
- data.tar.gz: 14e0f3810210f1eff1ea70873a9ef96acc1f0a84832fceb680f9fc9ab5399e8fcbe85134afe9f531c73105deb45ffc12abadcb20171a84ecf87084af68bff203
6
+ metadata.gz: 9c9aeb23ad9ada67f70b46cb0fb0d4722713be517c5b3a2b2d1dfd0671542774a86f5b2ade3cc0bfe403d0c6d4f50c62231f574c385116caca378be75fe2038e
7
+ data.tar.gz: 5443b1921db952dc03ad698d2f2f60e20c586957103d64316be5f56affdc92d1e6439f05d0c71291d3f0231b15efe2e25f852a725002a4da9bf1805574ad8198
@@ -6,13 +6,17 @@ export default class extends Controller {
6
6
  this.element.classList.add("twiddle")
7
7
 
8
8
  // If a child facet-value is selected, then expand the node
9
- if (this.element.querySelector(':scope > span.selected')) {
9
+ if (this.isChildSelected()) {
10
10
  this.element.classList.add('twiddle-open')
11
11
  this.element.querySelectorAll(':scope > .collapse')
12
12
  .forEach((collapsable) => collapsable.classList.add('show'))
13
13
  }
14
14
  }
15
15
 
16
+ isChildSelected() {
17
+ return this.element.querySelector('span.selected')
18
+ }
19
+
16
20
  toggle() {
17
21
  this.element.classList.toggle("twiddle-open")
18
22
  }
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Hierarchy
3
- VERSION = '6.2.1'.freeze
3
+ VERSION = '6.2.2'.freeze
4
4
  end
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-hierarchy",
3
- "version": "6.2.1",
3
+ "version": "6.2.2",
4
4
  "description": "[![Build Status](https://github.com/sul-dlss/blacklight-hierarchy/workflows/CI/badge.svg)](https://github.com/sul-dlss/blacklight-hierarchy/actions?query=branch%3Amain)",
5
5
  "main": "app/assets/javascripts/blacklight/hierarchy/hierarchy.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-hierarchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.1
4
+ version: 6.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael B. Klein