stimulus-rails 0.2.0 → 0.2.1

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: 4ea2a08da4eec91fdf57c9aedd06922f70d7d3a5393e02a5ae53ec56e0412e84
4
- data.tar.gz: ec8badcb14e076a0a85a27a6b7dd8fa704de2ac767e38ab2f7b23c63c9a5c777
3
+ metadata.gz: 89d46eae3d2f08243301a422cd4c81aceb024d2c9ad5d03c9c48d816bd3c0616
4
+ data.tar.gz: bcc92cdbbf0f10beb7bfae41100674e16a64864db47bfda5c16a586f5395e8f7
5
5
  SHA512:
6
- metadata.gz: 67387237ccb78c6a38702f83ba544aad12b2b3b95aa89895c945ba6bcada75894e302c11871528bf3f120be2a9717d69c16c221fc21cd4007c1bca32182279fb
7
- data.tar.gz: bd46dcadb94da2b2a1228c0817a0b590ff0ec9eaaf2fd68c669609e522d7d2e7f0a86b5cf5b29a383e1d119b02880d1b48075e355fcee4a2b40c5133bff8cf80
6
+ metadata.gz: 46f93ef00d23543f8ad325115d8a7c992fb2e9d231ec7fb42452aaabc4f3b629cb3fa4177a878f5c31596fec8aafe0d97a4908730d641c439cc39597d4336bca
7
+ data.tar.gz: 02a943d267d807a0981f65d82084e215e47ca35160eb14e67da6af5015598c16caac400304e66e1d377922a3854414945bdc7500f818740237b411266b92be67
@@ -35,9 +35,16 @@ function registerController(name, module) {
35
35
 
36
36
 
37
37
  new MutationObserver((mutationsList) => {
38
- for (const { attributeName, target } of mutationsList) {
39
- if (attributeName == controllerAttribute && target.hasAttribute(controllerAttribute)) {
40
- autoloadControllersWithin(target)
38
+ for (const { attributeName, target, type } of mutationsList) {
39
+ switch (type) {
40
+ case "attributes": {
41
+ if (attributeName == controllerAttribute && target.hasAttribute(controllerAttribute)) {
42
+ extractControllerNamesFrom(target).forEach(loadController)
43
+ }
44
+ }
45
+ case "childList": {
46
+ autoloadControllersWithin(target)
47
+ }
41
48
  }
42
49
  }
43
50
  }).observe(document.body, { attributeFilter: [controllerAttribute], subtree: true, childList: true })
@@ -1,3 +1,3 @@
1
1
  module Stimulus
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-01-19 00:00:00.000000000 Z
13
+ date: 2021-01-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails