effective_bootstrap 0.1.4 → 0.1.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: b9a288ad87b19d24f4b6e1975e47c1d3df2cb808
4
- data.tar.gz: b799987fbaecf619052a29fbf6af042e3df6c196
3
+ metadata.gz: 7d7f86a0d2683a7ba00bec65b642d7d68a5381a4
4
+ data.tar.gz: f0ce7680a8e5ff6df8a9e31bda7d3bb10fc789e0
5
5
  SHA512:
6
- metadata.gz: 76fc29549c4bc7cb4f5a6ae2b3f98eb159d8433f7ca504faea8d702f7204de98e180eb60aa36883db0cf43a3c66d5d7aeb3057723111c1567bb5cf1960fb3a8d
7
- data.tar.gz: 273ec9ef33c9e1cbade35f16fd150ba19fbe8897046f5af4e2312bb7b1910fcc87c72a9495a87b4c6b3ea1a853c68bf11b207155150167dcd507aa66ede1b38a
6
+ metadata.gz: 4b9cafa5062102c1b1eb947c569a94f7c53826892e778c359fefe56b730a84dbd9565f165a924912157b2408e8d58e4a8bd25604d680c087b6b738deea34c747
7
+ data.tar.gz: e934a6fac03621ee5789aa05ea607c225a1ebf5040fa68ae16b4d6deb24a462a1202f7a514cd71bfe7651638f615e14e8a5f27faf29d561abd632c9ca58e780f
@@ -40,3 +40,6 @@ $(document).on 'dp.end_date_initialized', (event) ->
40
40
  try
41
41
  date = $start_date.data('DateTimePicker').date()
42
42
  $end_date.data('DateTimePicker').minDate(date) if date
43
+
44
+ $(document).on 'click', '.effective_date_time_picker_input_group', (event) ->
45
+ $(event.currentTarget).children('input').data('DateTimePicker').show()
@@ -26,3 +26,6 @@
26
26
  background-color: inherit;
27
27
  }
28
28
 
29
+ .effective_date_time_picker_input_group {
30
+ cursor: pointer;
31
+ }
@@ -302,7 +302,7 @@ module Effective
302
302
  options[:input][:required] = 'required'
303
303
  end
304
304
 
305
- if options[:input][:readonly] || form_readonly?
305
+ if readonly?
306
306
  options[:input][:readonly] = 'readonly'
307
307
 
308
308
  unless options[:input][:class].to_s.include?('form-control-plaintext')
@@ -310,7 +310,7 @@ module Effective
310
310
  end
311
311
  end
312
312
 
313
- if disabled? || form_disabled?
313
+ if disabled?
314
314
  options[:input][:disabled] = 'disabled'
315
315
  end
316
316
 
@@ -359,8 +359,12 @@ module Effective
359
359
  @builder.readonly
360
360
  end
361
361
 
362
+ def readonly?
363
+ options.dig(:input, :readonly).present? || form_readonly?
364
+ end
365
+
362
366
  def disabled?
363
- options.dig(:input, :disabled).present?
367
+ options.dig(:input, :disabled).present? || form_disabled?
364
368
  end
365
369
 
366
370
  def form_disabled?
@@ -1,9 +1,16 @@
1
1
  module Effective
2
+
2
3
  module FormInputs
3
4
  class Checks < CollectionInput
4
5
 
5
6
  def build_input(&block)
6
- @builder.collection_check_boxes(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
7
+ html = @builder.collection_check_boxes(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
8
+
9
+ if disabled? # collection_check_boxes doesn't correctly disable the input type hidden, but does on the build_items
10
+ html = html.sub('<input type="hidden"', '<input type="hidden" disabled="disabled"').html_safe
11
+ end
12
+
13
+ html
7
14
  end
8
15
 
9
16
  def build_wrapper(&block)
@@ -14,7 +14,7 @@ module Effective
14
14
  end
15
15
 
16
16
  def input_group_options
17
- { input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
17
+ { input_group: { class: 'input-group effective_date_time_picker_input_group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
18
18
  end
19
19
 
20
20
  def datetime_to_s
@@ -14,7 +14,7 @@ module Effective
14
14
  end
15
15
 
16
16
  def input_group_options
17
- { input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
17
+ { input_group: { class: 'input-group effective_date_time_picker_input_group' }, prepend: content_tag(:span, icon('calendar'), class: 'input-group-text') }
18
18
  end
19
19
 
20
20
  def build_input(&block)
@@ -20,7 +20,13 @@ module Effective
20
20
 
21
21
  def build_input(&block)
22
22
  build_button_group do
23
- @builder.collection_radio_buttons(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
23
+ html = @builder.collection_radio_buttons(name, options_collection, value_method, label_method, collection_options, item_input_options) { |builder| build_item(builder) }
24
+
25
+ if disabled? # collection_check_boxes doesn't correctly disable the input type hidden, but does on the build_items
26
+ html = html.sub('<input type="hidden"', '<input type="hidden" disabled="disabled"').html_safe
27
+ end
28
+
29
+ html
24
30
  end
25
31
  end
26
32
 
@@ -14,7 +14,7 @@ module Effective
14
14
  end
15
15
 
16
16
  def input_group_options
17
- { input_group: { class: 'input-group' }, prepend: content_tag(:span, icon('clock'), class: 'input-group-text') }
17
+ { input_group: { class: 'input-group effective_date_time_picker_input_group' }, prepend: content_tag(:span, icon('clock'), class: 'input-group-text') }
18
18
  end
19
19
 
20
20
  def datetime_to_s
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.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: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect