effective_bootstrap 0.6.24 → 0.6.29
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/effective_bootstrap/logic.js.coffee +16 -2
- data/app/assets/javascripts/effective_bootstrap/tabs.js +4 -6
- data/app/assets/stylesheets/effective_bootstrap/forms.scss +0 -7
- data/app/helpers/effective_bootstrap_helper.rb +2 -2
- data/app/models/effective/form_inputs/select.rb +1 -1
- data/lib/effective_bootstrap/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: c26dafae8b20f6de729f010e19ba6690ccc45257fd7151fea3d7175715ae7a7d
|
4
|
+
data.tar.gz: 218ed4f9c1c4a0e8727bdd9af016829cfcb18f310004f3b3307a23b90d9e91ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0416207fe706d79b6cdecb1bc7d424f33786ec91ca26e887c93d8036339060854ca9d23d3e76072939b37ecddda44c6a1e19c380207b81c4e3c6571ed909539b
|
7
|
+
data.tar.gz: 45aa015d4e1648f49c7bad6909bc5ce1e6ee61d92fb93f9613253d719f1b8e38cc474578283ffc7e7a68d9dcfde02eabe4134c5853daf0beace9e88170bcecd0
|
@@ -2,7 +2,14 @@
|
|
2
2
|
$affects = $element.closest('form').find("input[name='#{options.name}'],select[name='#{options.name}']")
|
3
3
|
|
4
4
|
$affects.on 'change', (event) ->
|
5
|
-
|
5
|
+
$target = $(event.target)
|
6
|
+
matches = ($target.val() == options.value)
|
7
|
+
|
8
|
+
if $target.is("[type='checkbox']")
|
9
|
+
matches = matches || ($target.is(':checked') && "#{options.value}" == 'true')
|
10
|
+
matches = matches || (!$target.is(':checked') && ("#{options.value}" == 'false' || "#{options.value}" == ''))
|
11
|
+
|
12
|
+
if matches
|
6
13
|
$element.hide()
|
7
14
|
$element.find('input,textarea,select').prop('disabled', true)
|
8
15
|
else
|
@@ -18,7 +25,14 @@
|
|
18
25
|
$affects = $element.closest('form').find("input[name='#{options.name}'],select[name='#{options.name}']")
|
19
26
|
|
20
27
|
$affects.on 'change', (event) ->
|
21
|
-
|
28
|
+
$target = $(event.target)
|
29
|
+
matches = ($target.val() == options.value)
|
30
|
+
|
31
|
+
if $target.is("[type='checkbox']")
|
32
|
+
matches = matches || ($target.is(':checked') && "#{options.value}" == 'true')
|
33
|
+
matches = matches || (!$target.is(':checked') && ("#{options.value}" == 'false' || "#{options.value}" == ''))
|
34
|
+
|
35
|
+
if matches
|
22
36
|
$element.fadeIn()
|
23
37
|
$element.find('input,textarea,select').removeAttr('disabled')
|
24
38
|
else
|
@@ -1,16 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
$(document).ready(function() {
|
2
|
+
var $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane');
|
3
3
|
|
4
4
|
if ($tab_with_error.length > 0) {
|
5
5
|
$(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
|
6
6
|
} else if (document.location.hash.length > 0) {
|
7
|
-
|
7
|
+
var $tab_from_url = $(".nav.nav-tabs").find("a[href^='" + document.location.hash + "']");
|
8
8
|
|
9
9
|
if ($tab_from_url.length > 0) {
|
10
10
|
document.location.hash = ""; // This prevents scrolling to the wrong place in the page
|
11
11
|
$tab_from_url.tab("show");
|
12
12
|
}
|
13
13
|
}
|
14
|
-
}
|
15
|
-
|
16
|
-
$(document).ready(initTabs);
|
14
|
+
});
|
@@ -3,13 +3,6 @@
|
|
3
3
|
display: flex;
|
4
4
|
align-items: center;
|
5
5
|
position: relative;
|
6
|
-
|
7
|
-
// This is the inline ajax flash next to the save button.
|
8
|
-
.effective-form-flash {
|
9
|
-
position: absolute;
|
10
|
-
top: 3.0em;
|
11
|
-
z-index: 1;
|
12
|
-
}
|
13
6
|
}
|
14
7
|
|
15
8
|
form[data-remote="true"]:not(.show-flash-success) {
|
@@ -37,7 +37,7 @@ module EffectiveBootstrapHelper
|
|
37
37
|
|
38
38
|
link_opts[:class] = opts.delete(:link_class) || 'btn btn-link'
|
39
39
|
div_class = opts.delete(:div_class)
|
40
|
-
card_class = opts.delete(:card_class) || 'my-2'
|
40
|
+
card_class = opts.delete(:card_class) || 'card card-body my-2'
|
41
41
|
|
42
42
|
if @_accordion_active
|
43
43
|
# Accordion collapse
|
@@ -55,7 +55,7 @@ module EffectiveBootstrapHelper
|
|
55
55
|
# Normal collapse
|
56
56
|
content_tag(:a, label, link_opts) +
|
57
57
|
content_tag(:div, id: id, class: ['collapse', div_class, ('show' if show)].compact.join(' ')) do
|
58
|
-
content_tag(:div, capture(&block), class:
|
58
|
+
content_tag(:div, capture(&block), class: card_class)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|