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 +4 -4
- data/app/assets/javascripts/stimulus/loaders/autoloader.js +10 -3
- data/lib/stimulus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d46eae3d2f08243301a422cd4c81aceb024d2c9ad5d03c9c48d816bd3c0616
|
4
|
+
data.tar.gz: bcc92cdbbf0f10beb7bfae41100674e16a64864db47bfda5c16a586f5395e8f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
40
|
-
|
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 })
|
data/lib/stimulus/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|