satis 2.1.20 → 2.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75bb4d079d8749d5a4a09818abc3d32bc113a6053f57b1457832461115a0cbbf
4
- data.tar.gz: a6b3a0ecb3e696058fbd8f5963a31d34980e781b07bd399480732046ee89e620
3
+ metadata.gz: 6ca75490dbab4611d2d0a1b319d18476d2fbc0f6f632a9445a5774c9413dd2cc
4
+ data.tar.gz: bd10e5cf8b817f3d504bedf42aab73b2b36c1696abf09cb411ceaf2c1a8c8647
5
5
  SHA512:
6
- metadata.gz: a8cb4db65d76cbc6688425004e355c593e34bb2e034dcb2c297e7b647cdf594759439eb360cd442945896d27281aa9eaf4e81a8211bd7becdd370c142921dd9b
7
- data.tar.gz: 398590b2d41f81d54218ef937354b73d6072d7f78f6e7d99f2c66f35a62f4c7febfe549852fb3c7027348329c8b2648d6965f40167de3588b54e3044c06650e3
6
+ metadata.gz: 5e6e64c1b2953ecdbf9e8c7a2c9fa641ffbb45e8306a1d1d2661ca6a065c10adfd3eb1938fd5b42926c64ee78e55d7b4efde94fc5b8acf0cf4e426531b86e228
7
+ data.tar.gz: 6b3bc08e281f8c740984aff0c8a37eb14d62f6f28e91ea1c8287b565f5c2c5f835738d75795e6aa785d9bdb73c377a25dea9589fff84ac31c734d158ad8021fc
@@ -43,7 +43,7 @@ export default class extends ApplicationController {
43
43
  * Make sure that the toggle happens after the event bubble so any listeners are able to
44
44
  * process before we overwrite the template nodes that are possibly updated and reinsert new nodes.
45
45
  */
46
- setTimeout(()=>{
46
+ setTimeout(() => {
47
47
  this.toggle(this.currentValue)
48
48
  })
49
49
  }
@@ -57,8 +57,10 @@ export default class extends ApplicationController {
57
57
 
58
58
  this.insertionTarget.childNodes.forEach(iNode => {
59
59
  if (iNode.getAttribute("data-toggleable-node-id") == targetNodeId) {
60
- child.outerHTML = iNode.outerHTML
61
- iNode.remove()
60
+ if (child.parentElement) {
61
+ child.outerHTML = iNode.outerHTML
62
+ iNode.remove()
63
+ }
62
64
  }
63
65
  })
64
66
  })
@@ -70,7 +72,7 @@ export default class extends ApplicationController {
70
72
  // Reinsert elements
71
73
  this.toggleableTargets.forEach((element) => {
72
74
  if (element.getAttribute("data-toggle-value") == value || (element.getAttribute("data-toggle-not-value") != null && element.getAttribute("data-toggle-not-value") != value)) {
73
- element.content.childNodes.forEach(node => this.setUniqueId(node))
75
+ element.content.childNodes.forEach(node => this.setUniqueId(node))
74
76
 
75
77
  let toggleContent = document.importNode(element.content, true)
76
78
  toggleContent.childNodes.forEach((child) => {
@@ -91,8 +93,8 @@ export default class extends ApplicationController {
91
93
  }
92
94
  }
93
95
 
94
- setUniqueId(node) {
95
- if(node.getAttribute("data-toggleable-node-id")) return;
96
+ setUniqueId(node) {
97
+ if (node.getAttribute("data-toggleable-node-id")) return;
96
98
  const dateString = Date.now().toString(36);
97
99
  const randomness = Math.random().toString(36).substring(2);
98
100
  node.setAttribute("data-toggleable-node-id", dateString + randomness)
data/lib/satis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Satis
2
- VERSION = "2.1.20"
2
+ VERSION = "2.1.21"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.20
4
+ version: 2.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-20 00:00:00.000000000 Z
11
+ date: 2024-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser