vanilla_nested 1.5.1 → 1.6.0
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 +4 -4
- data/app/assets/javascripts/vanilla_nested.js +4 -2
- data/lib/vanilla_nested.rb +6 -0
- 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: 7164d9ce14876a0445fc8d3b30d14c18e5caca9771313e0f53034266d99363af
|
|
4
|
+
data.tar.gz: f49863e8b1d520de26f2ea5088753f89d228ce63a90f46fa0410655b5fe6c1f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ccd4bdf78c71155a3fde6bb26c250244b382868c3a74fb395463c76d55f8b7c7f318ef1b586d93ce191c8fc86fea0239ef8e301c257fe5753003cd3de04d85f
|
|
7
|
+
data.tar.gz: 9d3d0c45b8d9e7bcd8e456b8d4a7beacc05f97a46b677079add599b2741d03f48e25e3d826be600499ede979a6af414e9ed42af474e6b023c1d772579c20ba5e
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
|
|
54
54
|
const data = element.dataset;
|
|
55
55
|
let wrapper = element.parentElement;
|
|
56
|
-
|
|
56
|
+
const sel = data.fieldsWrapperSelector;
|
|
57
|
+
if (sel) wrapper = element.closest(sel);
|
|
57
58
|
|
|
58
59
|
if (data.undoTimeout) {
|
|
59
60
|
hideFieldsWithUndo(wrapper, element);
|
|
@@ -129,7 +130,8 @@
|
|
|
129
130
|
const undo = document.createElement('A');
|
|
130
131
|
|
|
131
132
|
undo.classList.add('vanilla-nested-undo');
|
|
132
|
-
|
|
133
|
+
const classes = data.undoLinkClasses;
|
|
134
|
+
if (classes)
|
|
133
135
|
undo.classList.add(...classes.split(' '));
|
|
134
136
|
|
|
135
137
|
undo.innerText = data.undoText;
|
data/lib/vanilla_nested.rb
CHANGED
|
@@ -9,5 +9,11 @@ module VanillaNested
|
|
|
9
9
|
ActionView::Base.send :include, VanillaNested::ViewHelpers
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
|
+
|
|
13
|
+
initializer "vanilla_nested.assets" do
|
|
14
|
+
if Rails.application.config.respond_to?(:assets)
|
|
15
|
+
Rails.application.config.assets.precompile += %w( vanilla_nested.js )
|
|
16
|
+
end
|
|
17
|
+
end
|
|
12
18
|
end
|
|
13
19
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vanilla_nested
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ariel Juodziukynas <arieljuod@gmail.com>
|
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: '0'
|
|
40
40
|
requirements: []
|
|
41
|
-
rubygems_version: 3.
|
|
41
|
+
rubygems_version: 3.2.22
|
|
42
42
|
signing_key:
|
|
43
43
|
specification_version: 4
|
|
44
44
|
summary: Dynamic nested forms using vanilla javascript
|