turbo_boost-elements 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,21 +26,23 @@ export default class ToggleTargetElement extends TurboBoostElement {
26
26
  // this.innerHTML = this.cachedHTML
27
27
  }
28
28
 
29
- collapse () {
30
- clearTimeout(this.collapseTimeout)
31
- this.collapseTimeout = setTimeout(() => {
32
- this.innerHTML = ''
33
- try {
34
- this.currentTriggerElement.expanded = false
35
- this.currentTriggerElement.hideDevtool()
36
- } catch {}
37
- }, 250)
29
+ collapse (delay = 250) {
30
+ if (delay > 0) {
31
+ clearTimeout(this.collapseTimeout)
32
+ return (this.collapseTimeout = setTimeout(() => this.collapse(0), delay))
33
+ }
34
+
35
+ this.innerHTML = ''
36
+ try {
37
+ this.currentTriggerElement.expanded = false
38
+ this.currentTriggerElement.hideDevtool()
39
+ } catch {}
38
40
  }
39
41
 
40
42
  collapseMatches () {
41
43
  document.querySelectorAll(this.collapseSelector).forEach(el => {
42
44
  if (el === this) return
43
- if (el.collapse) el.collapse()
45
+ if (el.collapse) el.collapse(0)
44
46
  })
45
47
  }
46
48
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TurboBoost
4
4
  module Elements
5
- VERSION = "0.0.6"
5
+ VERSION = "0.0.8"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo_boost-elements
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Hopkins (hopsoft)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-18 00:00:00.000000000 Z
11
+ date: 2023-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.8
47
+ version: 0.0.9
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.8
54
+ version: 0.0.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: magic_frozen_string_literal
57
57
  requirement: !ruby/object:Gem::Requirement