effective_bootstrap 0.9.41 → 0.9.45
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/confirm.js.coffee.erb +15 -7
- data/app/assets/javascripts/effective_file/initialize.js.coffee +6 -1
- data/app/assets/javascripts/effective_has_many/initialize.js.coffee +3 -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: 33fc32e5f8a20002ec07cc4cab552f7bd2e7386b162ce3043b9d2ba73771d2cb
|
|
4
|
+
data.tar.gz: d28055c2b76376a8efb83c2d89632883c4c599ccca5b5337eabb42f1242d8e6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b748f7cabd901caa3b9626c5bf4a0bc5d00cbc8269c8db15b809708895ac4e08104ec9f75cdf0dd5da0314c8182d882212beedb1aaf9ef72e0c9db43ad8dc0dc
|
|
7
|
+
data.tar.gz: 6c8259a2cf99443611d197da78129382d1a6c4f870d7678458bf71a49f3ed60cbc64c7c8876482fa93244fdb2b139cb9396af4b8276fa0b858d25431cfad766f
|
|
@@ -4,19 +4,27 @@ if <%= !!EffectiveBootstrap.use_custom_data_confirm %> && (window.Rails || $.rai
|
|
|
4
4
|
$(document).on 'confirm', (event) ->
|
|
5
5
|
$obj = $(event.target)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
# Already confirmed
|
|
8
|
+
return true if $obj.data('confirmed')
|
|
9
|
+
|
|
10
|
+
# Otherwise unconfirmed
|
|
11
|
+
$obj.data('confirm-original', $obj.html())
|
|
12
|
+
$obj.html($obj.data('confirm'))
|
|
13
|
+
$obj.data('confirmed', true)
|
|
14
|
+
|
|
15
|
+
# When using the direct to s3 active storage javascript library
|
|
16
|
+
$activeStorageUpload = $obj.closest('form').find('input[type=file][data-direct-upload-url]')
|
|
17
|
+
|
|
18
|
+
if $activeStorageUpload.length == 0
|
|
13
19
|
setTimeout(
|
|
14
20
|
(->
|
|
15
21
|
$obj.data('confirmed', false)
|
|
16
22
|
$obj.html($obj.data('confirm-original'))
|
|
17
23
|
)
|
|
18
24
|
, 4000)
|
|
19
|
-
|
|
25
|
+
|
|
26
|
+
# Do not display the confirmation dialog
|
|
27
|
+
false
|
|
20
28
|
|
|
21
29
|
if window.Rails
|
|
22
30
|
window.Rails.confirm = (message) -> true
|
|
@@ -13,7 +13,12 @@ $(document).on 'direct-upload:error', (event) ->
|
|
|
13
13
|
$("[data-direct-upload-id=#{event.detail.id}]").addClass('direct-upload--error').attr('title', event.detail.error)
|
|
14
14
|
|
|
15
15
|
$(document).on 'direct-upload:end', (event) ->
|
|
16
|
-
$("[data-direct-upload-id=#{event.detail.id}]")
|
|
16
|
+
$obj = $("[data-direct-upload-id=#{event.detail.id}]")
|
|
17
|
+
|
|
18
|
+
$obj.addClass('direct-upload--complete')
|
|
19
|
+
|
|
20
|
+
# Rails UJS fix
|
|
21
|
+
$obj.closest('form').find('[type=submit][data-confirm]').data('confirmed', true)
|
|
17
22
|
|
|
18
23
|
$(document).on 'change', "input[type='file'][data-click-submit]", (event) ->
|
|
19
24
|
$(event.currentTarget).closest('form').find('button[type=submit],input[type=submit]').first().click()
|
|
@@ -68,7 +68,9 @@ $(document).on 'click', '[data-effective-form-has-many-remove]', (event) ->
|
|
|
68
68
|
event.preventDefault()
|
|
69
69
|
|
|
70
70
|
$obj = $(event.currentTarget)
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
if (window.Rails && window.Rails.effective_bootstrap_custom_data_confirm) || ($.rails && $.rails.effective_bootstrap_custom_data_confirm)
|
|
73
|
+
return unless $obj.data('confirmed') if $obj.data('confirm')
|
|
72
74
|
|
|
73
75
|
$hasMany = $obj.closest('.form-has-many')
|
|
74
76
|
return unless $hasMany.length > 0
|
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.9.
|
|
4
|
+
version: 0.9.45
|
|
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: 2021-
|
|
11
|
+
date: 2021-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|