effective_bootstrap 0.9.41 → 0.9.42

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
  SHA256:
3
- metadata.gz: 2b496c8193535d6f7bb0a74e49665dec14d0330b26682753c5b8721a00da0288
4
- data.tar.gz: 20d00e39d97d38d350f81c69abb3fbe35a4e9950b5807108a1c5b819cf596545
3
+ metadata.gz: 5bfd09a27598da184de3a2f8208d36db4ac3021c76946dc45f7c7c81ed0d0b1f
4
+ data.tar.gz: e62446f65854520af700752157415cf606d18b43ac631726394c26895a8df705
5
5
  SHA512:
6
- metadata.gz: 4e8e3c0416424d8f2a675f704a7088b9a5edbc8cbb26d8d8853ad1b9c7d2dac98cf2c7a4352e23ad9a5fd6398c7713d7602cd552e9d95311cf74ea0fdc1b0e51
7
- data.tar.gz: 5c5bd0a118f9a68b8901fab25692e95a1728ebdb9a00744a93567fe1185fc23f02d4948609906c75b949440e1340ceaa298fb053f5807cd24195bc825fc2666d
6
+ metadata.gz: 2ca774aa86d286554166d8780d0a8ba4ddbe187f4decb5295e83728d63b5b5eb7723abd5bf1aa74881ca36c983c94d2fc8b88fb6ed58fbdc7759287ae7886a70
7
+ data.tar.gz: 9f15e36d568891a388fd9c788887f9fadd195d5bc81d06bf04ba899161a76a55a676850311f41efbb0ec55458b523091c36ca86ddfe430e282b9d402d875fdd7
@@ -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
- if $obj.data('confirmed')
8
- true
9
- else
10
- $obj.data('confirm-original', $obj.html())
11
- $obj.html($obj.data('confirm'))
12
- $obj.data('confirmed', true)
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
- false # don't show the confirmation dialog
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}]").addClass('direct-upload--complete')
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()
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.9.41'.freeze
2
+ VERSION = '0.9.42'.freeze
3
3
  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.9.41
4
+ version: 0.9.42
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-09-08 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails