rails-sweetalert2-confirm 0.9.8 → 0.9.9

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
- SHA1:
3
- metadata.gz: 1423bcc9a21daca893c5ebf0882f549f21032667
4
- data.tar.gz: 3fd604c6fc7f19f5b13fcb4091372df153ae7300
2
+ SHA256:
3
+ metadata.gz: 9eeb4081353a69ee10a183653fd4e7075f89fd20023fe27f3efe174468035736
4
+ data.tar.gz: 67a6c67e158a6bd5f5f5960d3ea6bfa83d6a91edd36f74af054e336a2b57cba8
5
5
  SHA512:
6
- metadata.gz: 58e3d4a38b7b47d4322528334f156855c231054faf6cf2b937ec66d71db7129b496f0657efb14963472014e3a982b79390c80eb2c6582f0bcf5dd5f4ec4ca4bf
7
- data.tar.gz: 0607985d4a74c65ae178787dd5f734e759375d49fd02e9cb23e317a599fe49eb40789008a75d5f0e5ebb4e70c34dc2257013bc139f1f0bf5b74593bafe10a67a
6
+ metadata.gz: 85e0cf7c29017a3b5622080d49977a2f3bac352e85ea8fe6b5d5333a4650e52d58352d89a685d8db09f1c55de72a5157537f705c430f23c0d0abb787fdd33852
7
+ data.tar.gz: 4936068d2d56909404cad014ed46c9df661069961f562a3bf197d01d47b1ecbaec67aeb83c89d4fabd2e1ef2ccd6ec8a2ecced86b601b32f83f43a5fdda90cad
data/README.md CHANGED
@@ -15,7 +15,7 @@ Installation
15
15
  # Gemfile
16
16
 
17
17
  gem 'rails-sweetalert2-confirm'
18
- gem 'rails-assets-sweetalert2', source 'https://rails-assets.org'
18
+ gem 'rails-assets-sweetalert2', source: 'https://rails-assets.org'
19
19
  ```
20
20
 
21
21
  ```javascript
@@ -168,7 +168,13 @@ var sweetAlertConfirm = function(event) {
168
168
  var afterConfirm = sweetAlertConfirmDefaults.afterConfirm || $linkToConfirm.data('swal').after_confirm || null
169
169
  var afterDismiss = sweetAlertConfirmDefaults.afterDismiss || $linkToConfirm.data('swal').after_dismiss || null
170
170
 
171
- swal(swalOptions).then(afterConfirmCallback, afterDismissCallback);
171
+ swal(swalOptions).then(result => {
172
+ if (result.value) {
173
+ afterConfirmCallback();
174
+ } else {
175
+ afterDismissCallback();
176
+ };
177
+ });
172
178
  return false;
173
179
  };
174
180
 
@@ -1,3 +1,3 @@
1
1
  module RailsSweetAlert2Confirm
2
- VERSION = "0.9.8"
2
+ VERSION = "0.9.9"
3
3
  end
@@ -26,14 +26,14 @@ module RailsSweetAlert2Confirm
26
26
  protected
27
27
 
28
28
  def merge_options_into_swal(options)
29
- return options unless options_has_confirm?(options)
30
29
  options = merge_confirm_into_swal(options)
31
30
  options = merge_remote_into_swal(options)
32
31
  merge_method_into_swal(options)
33
32
  end
34
33
 
35
- %w(remote method confirm).each_with_index do |option|
34
+ %w(remote method confirm).each do |option|
36
35
  define_method("merge_#{option}_into_swal") do |options|
36
+ return if %w(remote method).include?(option) && !options_has_confirm?
37
37
  if send("options_has_#{option}?", options)
38
38
  options[:data] ||= {}
39
39
  options[:data][:swal] ||= {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sweetalert2-confirm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Woodward
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-25 00:00:00.000000000 Z
11
+ date: 2019-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -233,9 +233,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  version: '0'
234
234
  requirements: []
235
235
  rubyforge_project:
236
- rubygems_version: 2.4.5
236
+ rubygems_version: 2.7.6
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: A Rails Confirm Replacement Using SweetAlert2
240
240
  test_files: []
241
- has_rdoc: