rails-sweetalert2-confirm 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd16665f4747d5ba63d484e14233a8b780ab8b06
|
4
|
+
data.tar.gz: 6688a931595c4f91dce4de7d5180f27c371e5f7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb4eec7955ab8e4613d2b631782d25f53544c6a7ff00e9ec6316a9ab8b35a883e9dc0bf31a0f190e712202b166c330b3db1fd532853fde4bb1ba451e4bbc1b60
|
7
|
+
data.tar.gz: 1cd75ec42ec9fd0839b687b1d0f7968d77588d60d131ba1cee975f32fdc99c3c287d917c516ff9162c2b0b6e410e9e74f3a92b93b82377ecc783c2f0ee4e73c1
|
@@ -29,18 +29,27 @@ module RailsSweetAlert2Confirm
|
|
29
29
|
merge_remote_into_swal(options)
|
30
30
|
end
|
31
31
|
|
32
|
-
%w(confirm remote).each do |option|
|
32
|
+
%w(confirm remote method).each do |option|
|
33
33
|
define_method("merge_#{option}_into_swal") do |options|
|
34
34
|
if send("options_has_#{option}?", options)
|
35
35
|
options[:data] ||= {}
|
36
36
|
options[:data][:swal] ||= {}
|
37
37
|
option = option.to_sym
|
38
38
|
options[:data][:swal][SWAL_OPTIONS_MAPPINGS[option]] =
|
39
|
-
|
39
|
+
send("retrieve_#{option}_from", options)
|
40
40
|
end
|
41
41
|
options
|
42
42
|
end
|
43
43
|
|
44
|
+
define_method("retrieve_#{option}_from") do |options|
|
45
|
+
case option
|
46
|
+
when "method"
|
47
|
+
options[option] || options[:data][option]
|
48
|
+
else
|
49
|
+
options.delete(option) || options[:data].delete(option)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
44
53
|
define_method("options_has_#{option}?") do |options|
|
45
54
|
option = option.to_sym
|
46
55
|
(options[option] || options[:data].try(:[], option)).present?
|