effective_bootstrap 1.26.3 → 1.26.4

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: af1499bdd3b77b6451a0a196fb9c62e6e4139c5369ef49aa56a42f72cdc4f360
4
- data.tar.gz: f9b452dbc296dc48db3e29132481a1bb917f5691603ffb31948236e12ab1cc39
3
+ metadata.gz: ca3151713ddf3fe2ba10d003040a7337e4af6fc606d20e1228e6d8f397bc7ed8
4
+ data.tar.gz: 8f51c987255a11ed33121e9c891a4615b2f05d449c32245e3a6fe3023645529f
5
5
  SHA512:
6
- metadata.gz: 3cdc9f65d070e5f3539fa1670b8464e78cb32559c758e73ea944574f81e369c8dea237503ed63e0c880bc4023ca2f19d2dfd63813c14586b573937be7e838e06
7
- data.tar.gz: e61dd1b4bdaaf2482e54412de96c78275828f84d8672570809264580610941736a48fca4c9c6e563b2505880c9ecc9ac3608bbf09c99ddf8bcafd724e1bbec3c
6
+ metadata.gz: 2b4a0afdb255cb6c3e2111aee0a2ace632aa7a5c36ad716d25b2ad0d31ece912033876f30d02e3e161bb0640011cb8914e4394923dbabf1c168a25e1e5f477bb
7
+ data.tar.gz: 96385c23409c64e43152fd35e2ce4eb957b9e315a86029816f36f8c810a245901f9d4886e1f0ab9cd27200ebb205478a811c34b20e3479af6db51fbc6349677b
@@ -56,6 +56,7 @@ this.EffectiveForm ||= new class
56
56
  @flash($form, 'danger')
57
57
 
58
58
  disable: ($form) ->
59
+ if window.Rails then Rails.disableElement($form[0]) else $.rails?.disableFormElements($form)
59
60
  $form.find('[type=submit]').prop('disabled', true)
60
61
 
61
62
  reset: ($form) ->
@@ -69,6 +70,7 @@ this.EffectiveForm ||= new class
69
70
  $form.find('.is-invalid').removeClass('is-invalid')
70
71
  $form.find('.is-valid').removeClass('is-valid')
71
72
 
73
+ if window.Rails then Rails.enableElement($form[0]) else $.rails?.enableFormElements($form)
72
74
  $form.find('[type=submit]').removeAttr('disabled')
73
75
  $form
74
76
 
@@ -70,13 +70,15 @@ $(document).on 'click', '[data-effective-form-has-many-insert]', (event) ->
70
70
  $(document).on 'click', '[data-effective-form-has-many-remove-disabled]', (event) ->
71
71
  event.preventDefault()
72
72
 
73
- $(document).on 'click', '[data-effective-form-has-many-remove]', (event) ->
74
- event.preventDefault()
75
-
73
+ $(document).on 'click confirm:complete', '[data-effective-form-has-many-remove]', (event, answer) ->
76
74
  $obj = $(event.currentTarget)
77
75
 
78
- if (window.Rails && window.Rails.effective_bootstrap_custom_data_confirm) || ($.rails && $.rails.effective_bootstrap_custom_data_confirm)
79
- return unless $obj.data('confirmed') if $obj.data('confirm')
76
+ if event.type == 'click'
77
+ event.preventDefault()
78
+ # Let Rails finish confirmation before disabling the row, including this button.
79
+ return if $obj.data('confirm') && (window.Rails || $.rails)
80
+ else
81
+ return unless answer || event.originalEvent?.detail?[0]
80
82
 
81
83
  $hasMany = $obj.closest('.form-has-many')
82
84
  return unless $hasMany.length > 0
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '1.26.3'.freeze
2
+ VERSION = '1.26.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.26.3
4
+ version: 1.26.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect