effective_bootstrap 0.0.11 → 0.0.12
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21cb74427ba892b8619697fdbc5326ba5501f5af
|
|
4
|
+
data.tar.gz: c4a4e3c701a95d3ead37342482f062ad38f81da6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 299e0d77e352e6fd9ca97c619896dec1ad9c85c215ee3eff0c4ea367992f1b52627b99a85e25e532b465b4a9e75661bac23d1204ecda6576c8cea9b284c4cd55
|
|
7
|
+
data.tar.gz: 71a77943a61d77d15fe376e89f76ca5bc32bbe8c9fd360dd4344f52e0f723f05f72b7a11eef7847f91d37133d343eef5791c6c165ea17b6c9087611f33d053a5
|
|
@@ -49,7 +49,7 @@ this.EffectiveForm ||= new class
|
|
|
49
49
|
beforeAjax: ($form) ->
|
|
50
50
|
return unless $form.data('remote')
|
|
51
51
|
|
|
52
|
-
$form.one 'ajax:success', (event,
|
|
52
|
+
$form.one 'ajax:success', (event, data, status) ->
|
|
53
53
|
EffectiveForm.loadFromAjax($(event.target), $(event.target).data('method') == 'delete')
|
|
54
54
|
|
|
55
55
|
$form.one 'ajax:error', (event, _, status, message) ->
|
|
@@ -59,26 +59,34 @@ this.EffectiveForm ||= new class
|
|
|
59
59
|
# Loads remote for payload that was placed here by effective_resources create.js.erb and update.js.erb
|
|
60
60
|
loadFromAjax: ($target, was_delete) ->
|
|
61
61
|
$target = $target.closest('form') unless $target.is('form')
|
|
62
|
+
$form = ''
|
|
62
63
|
|
|
63
64
|
if @remote_form_payload.length > 0
|
|
64
65
|
$form = @remote_form_payload.find("form[data-remote-index='#{$target.data('remote-index')}']")
|
|
65
|
-
$form = @remote_form_payload.find('form') if $form.length == 0
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
$form = @remote_form_payload.find('form').first() if $form.length == 0
|
|
67
|
+
|
|
68
|
+
return if @remote_form_payload.length == 0 || $form.length == 0
|
|
69
|
+
|
|
70
|
+
EffectiveBootstrap.initialize($form)
|
|
71
|
+
$target.replaceWith($form)
|
|
72
|
+
@remote_form_payload = ''
|
|
73
|
+
|
|
74
|
+
# There's nothing to update if it was a successful delete
|
|
75
|
+
return if was_delete
|
|
69
76
|
|
|
70
77
|
# We update the current submit to point to the new one.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
@current_submit = $form.find("##{@current_submit.attr('id')}.form-actions")
|
|
78
|
+
if @current_submit.length > 0
|
|
79
|
+
@current_submit = $form.find("##{@current_submit.attr('id')}.form-actions")
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
if @remote_form_flash.length > 0
|
|
82
|
+
for flash in @remote_form_flash
|
|
83
|
+
@flash($form, flash[0], flash[1], true)
|
|
78
84
|
|
|
79
|
-
|
|
85
|
+
@remote_form_flash = ''
|
|
80
86
|
|
|
81
87
|
flash: ($form, status, message, skip_success = false) ->
|
|
88
|
+
return unless @current_submit.length > 0
|
|
89
|
+
|
|
82
90
|
if status == 'danger' || status == 'error'
|
|
83
91
|
@current_submit.find('.eb-icon-x').show().delay(1000).fadeOut('slow')
|
|
84
92
|
else
|
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
height: 1.6rem;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.eb-icon.big-1 {
|
|
7
|
+
width: (1.6rem * 1.25);
|
|
8
|
+
height: (1.6rem * 1.25);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.eb-icon.big-2 {
|
|
12
|
+
width: (1.6rem * 1.5);
|
|
13
|
+
height: (1.6rem * 1.5);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.eb-icon.big-3 {
|
|
17
|
+
width: (1.6rem * 2.0);
|
|
18
|
+
height: (1.6rem * 2.0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.eb-icon.big-4 {
|
|
22
|
+
width: (1.6rem * 4.0);
|
|
23
|
+
height: (1.6rem * 4.0);
|
|
24
|
+
}
|
|
25
|
+
|
|
6
26
|
.input-group-text {
|
|
7
27
|
.eb-icon {
|
|
8
28
|
width: 1.2rem;
|
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.0.
|
|
4
|
+
version: 0.0.12
|
|
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: 2018-04-
|
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|