effective_bootstrap 0.3.14 → 0.3.15
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bbf6bd3ec7def180b40cbcb63051fd4df9bcd34
|
4
|
+
data.tar.gz: 6a12b389a429f0172bc3c98e07f5309591a22c1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fc72b857ca9fd5b05396472c55ebd870aa4c739f749f84d96ce658e71d4a3b68ade1ad128d0d7923dfbe3d525a2d426aeb9b9050140f23cffa4534ea1a54b4f
|
7
|
+
data.tar.gz: 03b7fabea05279fb5579cbf61fbbf753234c5768547db87dc1ad3a45de917d02303e477b22834bffad17a9ad729c2e290ac5ee944be6afd8427f6e245c21a477
|
@@ -13,8 +13,15 @@ $(document).on('click', '[data-effective-select-or-text]', function(event) {
|
|
13
13
|
$visible = $obj.children('.form-group:visible').first();
|
14
14
|
$hidden = $obj.children('.form-group:not(:visible)').first();
|
15
15
|
|
16
|
-
$visible.
|
17
|
-
$hidden.
|
16
|
+
visible_name = $visible.find('input,textarea,select').first().attr('name');
|
17
|
+
hidden_name = $hidden.find('input,textarea,select').first().attr('name');
|
18
|
+
|
19
|
+
if(visible_name == hidden_name) { $hidden.find('input,textarea,select').removeAttr('disabled'); }
|
20
|
+
|
21
|
+
$visible.fadeOut('fast', function() {
|
22
|
+
if(visible_name == hidden_name) { $(this).find('input,textarea,select').prop('disabled', true); }
|
23
|
+
$hidden.fadeIn('fast');
|
24
|
+
});
|
18
25
|
|
19
26
|
return false; // This implicitly calls event.preventDefault() to cancel the action, and prevent the link from going somewhere.
|
20
27
|
});
|
@@ -7,7 +7,7 @@ module Effective
|
|
7
7
|
attr_accessor :text_options
|
8
8
|
|
9
9
|
VISIBLE = {}
|
10
|
-
|
10
|
+
HIDDEN_AND_DISABLED = { wrapper: { style: 'display: none;' }, disabled: true }
|
11
11
|
|
12
12
|
def initialize(name, options, builder:)
|
13
13
|
@name_text = options.delete(:name_text) || raise('Please include a text method name')
|
@@ -36,13 +36,13 @@ module Effective
|
|
36
36
|
return true if object.errors[name].present?
|
37
37
|
return false if object.errors[name_text].present?
|
38
38
|
|
39
|
-
|
39
|
+
value = object.send(name)
|
40
|
+
|
41
|
+
(value.present? && select_collection.include?(value)) || (value.blank? && object.send(name_text).blank?)
|
40
42
|
end
|
41
43
|
|
42
44
|
def text?
|
43
|
-
|
44
|
-
|
45
|
-
object.send(name_text).present? || object.errors[name_text].present?
|
45
|
+
!select?
|
46
46
|
end
|
47
47
|
|
48
48
|
def email_field?
|
@@ -50,11 +50,11 @@ module Effective
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def select_options
|
53
|
-
@select_options.merge(select? ? VISIBLE :
|
53
|
+
@select_options.merge(select? ? VISIBLE : HIDDEN_AND_DISABLED)
|
54
54
|
end
|
55
55
|
|
56
56
|
def text_options
|
57
|
-
@text_options.merge(text? ? VISIBLE :
|
57
|
+
@text_options.merge(text? ? VISIBLE : HIDDEN_AND_DISABLED)
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
%p These icons are a combination of #{link_to 'Feather', 'https://feathericons.com/'} and #{link_to 'FontAwesome', 'https://fontawesome.com/'} icons.
|
2
2
|
|
3
3
|
.row.text-center
|
4
|
-
- Dir["#{__dir__}
|
4
|
+
- Dir["#{__dir__}#{'/..' * 3}/assets/images/icons/*.svg"].map { |path| path.split('/').last.chomp('.svg') }.sort.each do |name|
|
5
5
|
.col-sm-2.my-3
|
6
6
|
= icon(name)
|
7
7
|
%br
|
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.3.
|
4
|
+
version: 0.3.15
|
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: 2019-02-
|
11
|
+
date: 2019-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|