effective_form_inputs 1.1.11 → 1.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_date_picker/initialize.js.coffee +1 -0
- data/app/assets/javascripts/effective_date_time_picker/initialize.js.coffee +1 -0
- data/app/assets/javascripts/effective_date_time_picker/overrides.js.coffee +25 -5
- data/app/assets/javascripts/effective_time_picker/initialize.js.coffee +1 -0
- data/app/models/inputs/effective_select/input.rb +1 -1
- data/app/models/inputs/effective_time_picker/input.rb +4 -0
- data/lib/effective_form_inputs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82987aa71a7ea0640039fdac3962555a982810d6
|
4
|
+
data.tar.gz: d3784ba5af000a1e585e013ff83720d0d6e672e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9f416cf372c13830b9f1d4d1ca8b417de19bcc801432f2a66f9e80469c6ff4b061817344ff0a0a2fc6ef8a9ff183394a385cd7c54d142ac661b01f380f0c4f2
|
7
|
+
data.tar.gz: d1dd15c4e4d29e5f4a3b3b9bb82a52b7da4d3ef62c1de666938a6d7de6de3bf7dd8bcaf4cbd3facff74282060a51957d56050c311c11a1c7fcad791519736979
|
@@ -6,6 +6,7 @@ initialize = ->
|
|
6
6
|
options = element.data('input-js-options') || {}
|
7
7
|
|
8
8
|
element.addClass('initialized').datetimepicker(options)
|
9
|
+
element.trigger('dp.end_date_initialized') if (element.attr('name') || '').indexOf('[end_') != -1
|
9
10
|
|
10
11
|
$ -> initialize()
|
11
12
|
$(document).on 'page:change', -> initialize()
|
@@ -6,6 +6,7 @@ initialize = ->
|
|
6
6
|
options = element.data('input-js-options') || {}
|
7
7
|
|
8
8
|
element.addClass('initialized').datetimepicker(options)
|
9
|
+
element.trigger('dp.end_date_initialized') if (element.attr('name') || '').indexOf('[end_') != -1
|
9
10
|
|
10
11
|
$ -> initialize()
|
11
12
|
$(document).on 'page:change', -> initialize()
|
@@ -2,12 +2,32 @@ $(document).on 'dp.hide', (event) -> $(event.target).trigger('keyup')
|
|
2
2
|
|
3
3
|
# When an input with field named "start_*" is changed, set it's corresponding "end_*" minDate
|
4
4
|
$(document).on 'dp.change', (event) ->
|
5
|
-
$
|
5
|
+
$start_date = $(event.target)
|
6
6
|
|
7
|
-
return if $
|
8
|
-
return if $
|
7
|
+
return if $start_date.hasClass('not-date-linked')
|
8
|
+
return if ($start_date.attr('name') || '').indexOf('[start_') == -1
|
9
9
|
|
10
|
-
end_date = $
|
11
|
-
$end_date = $
|
10
|
+
end_date = $start_date.attr('name').replace('[start_', '[end_')
|
11
|
+
$end_date = $start_date.closest('form').find("input[name='#{end_date}'].initialized")
|
12
|
+
|
13
|
+
return if $end_date.length == 0
|
14
|
+
return if $end_date.hasClass('not-date-linked')
|
12
15
|
|
13
16
|
try $end_date.data('DateTimePicker').minDate(event.date)
|
17
|
+
|
18
|
+
# When an input with field named "end_*" is initialized, set it's corresponding "start_*" minDate
|
19
|
+
$(document).on 'dp.end_date_initialized', (event) ->
|
20
|
+
$end_date = $(event.target)
|
21
|
+
|
22
|
+
return if $end_date.hasClass('not-date-linked')
|
23
|
+
return if ($end_date.attr('name') || '').indexOf('[end_') == -1
|
24
|
+
|
25
|
+
start_date = $end_date.attr('name').replace('[end_', '[start_')
|
26
|
+
$start_date = $end_date.closest('form').find("input[name='#{start_date}'].initialized")
|
27
|
+
|
28
|
+
return if $start_date.length == 0
|
29
|
+
return if $start_date.hasClass('not-date-linked')
|
30
|
+
|
31
|
+
try
|
32
|
+
date = $start_date.data('DateTimePicker').date()
|
33
|
+
$end_date.data('DateTimePicker').minDate(date) if date
|
@@ -6,6 +6,7 @@ initialize = ->
|
|
6
6
|
options = element.data('input-js-options') || {}
|
7
7
|
|
8
8
|
element.addClass('initialized').datetimepicker(options)
|
9
|
+
element.trigger('dp.end_date_initialized') if (element.attr('name') || '').indexOf('[end_') != -1
|
9
10
|
|
10
11
|
$ -> initialize()
|
11
12
|
$(document).on 'page:change', -> initialize()
|
@@ -151,7 +151,7 @@ module Inputs
|
|
151
151
|
def js_options
|
152
152
|
@effective_select_js_options ||= super().tap do |js_options|
|
153
153
|
js_options[:allowClear] = (options[:multiple] != true)
|
154
|
-
js_options[:tags] = (options[:tags] == true)
|
154
|
+
js_options[:tags] = (options[:tags] == true) unless js_options.key?(:tags)
|
155
155
|
js_options[:tokenSeparators] = nil if options[:tags] != true
|
156
156
|
js_options[:template] = options[:template] if options[:template].present?
|
157
157
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_form_inputs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.12
|
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: 2017-10-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|