anjlab-widgets 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/anjlab-widgets/simple_form.rb +10 -9
- data/lib/anjlab-widgets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b28cad81dd959212c38fee9995139ba90bc1fad1
|
4
|
+
data.tar.gz: b9e9619dd628e85f3b5168e2565cd750ea7982d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 453d5864f433f2c27c4894a6878af0ce2b5bc06a46bd6d1655967853f4a37ba45c19e455081793b4b5ac727ad4de2c3b7665640500eebc4ab1f0231bcf2008d5
|
7
|
+
data.tar.gz: f32c486fac38bf9c8b0adeddc202a2288d094822ec98b27a4de1eaecef9b203eeb8adb7c67ad2dc805350d3976a9eac0ed84fb1e721acf126a62234c43a946e6
|
data/.gitignore
CHANGED
@@ -6,31 +6,32 @@ module Anjlab
|
|
6
6
|
attribute_name
|
7
7
|
end
|
8
8
|
|
9
|
-
def input
|
9
|
+
def input(wrapper_options)
|
10
10
|
time = options[:value] || @builder.object.send(attribute_name)
|
11
11
|
|
12
12
|
html = ''.html_safe
|
13
13
|
|
14
14
|
allow_blank = !options[:required]
|
15
|
+
source_options = merge_wrapper_options(input_html_options, wrapper_options)
|
15
16
|
|
16
17
|
date_data = {
|
17
18
|
"data-widget" => "datepicker",
|
18
19
|
"data-rails" => true,
|
19
20
|
"data-date-allow-blank" => allow_blank,
|
20
21
|
:value => Widgets::format_date(time),
|
21
|
-
:required =>
|
22
|
-
:class => "#{
|
23
|
-
:placeholder => "#{
|
24
|
-
}.merge(
|
22
|
+
:required => source_options[:required],
|
23
|
+
:class => "#{source_options[:date_class] || 'input-small'}",
|
24
|
+
:placeholder => "#{source_options[:date_placeholder]}"
|
25
|
+
}.merge(source_options)
|
25
26
|
|
26
27
|
time_data = {
|
27
28
|
"data-widget" => "timepicker",
|
28
29
|
"data-rails" => true,
|
29
30
|
:value => Widgets::format_time(time),
|
30
|
-
:required =>
|
31
|
-
:class => "#{
|
32
|
-
:placeholder => "#{
|
33
|
-
}.merge(
|
31
|
+
:required => source_options[:required],
|
32
|
+
:class => "#{source_options[:time_class] || 'input-small'}",
|
33
|
+
:placeholder => "#{source_options[:time_placeholder]}"
|
34
|
+
}.merge(source_options)
|
34
35
|
|
35
36
|
case input_type
|
36
37
|
when :datetime, :anjlab_datetime
|