effective_bootstrap 0.2.2 → 0.2.3

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
2
  SHA1:
3
- metadata.gz: 0dcabe6562a28a9ad9845025ee4ba974ca38c846
4
- data.tar.gz: 8b022529edf57d27fd3507dab9029c0242297acc
3
+ metadata.gz: a9a6d951deeba08d113ac19bdfed662eb48c9692
4
+ data.tar.gz: 6643a8efbff7d4d5fccf3fc12f3bd804eca6926d
5
5
  SHA512:
6
- metadata.gz: 3626fa1ca74154ace16f44e117d0ebef60ec2d9e68dad9d87bbb1f5b10b5fefca5855683cfd9ec2fa981c1028fb4ec2873e1552a3d73936bb6fbf8bc46c612f5
7
- data.tar.gz: 7d17e33751e29a7cbc81e94a7afcb74dd4bef5634a333d1e8a360d724490b80b28728f8f79dde48712e26b4f8066c00888cde0c61c5a4d32698cd8d0c1327c39
6
+ metadata.gz: 42711f03fa1bbb0ca9d0225988f5c0ce707c04d6981077b7a31f1d9172ec3647561a99940382df742847976b4f4900745f5a921665bba38cc6521079ab4a5a55
7
+ data.tar.gz: a2c063827ca23869e1c61bda8dd0d278aad5ab0bf101b2b6df5d79357cdf329f00cb0691694d517be5d362c01467c96a67214ffe42e4da6eec4aa03109c43f44
@@ -33,7 +33,7 @@ module Effective
33
33
  minimumResultsForSearch: 6,
34
34
  width: 'style',
35
35
  placeholder: (input_html_options.delete(:placeholder) || 'Please choose'),
36
- allowClear: !multiple?,
36
+ allowClear: (true if include_blank?),
37
37
  tokenSeparators: ([',', ';', '\n', '\t'] if tags?),
38
38
  tags: (true if tags?),
39
39
  template: js_template,
@@ -52,11 +52,16 @@ module Effective
52
52
  ('tags-input' if tags?),
53
53
  ].compact.join(' ')
54
54
 
55
- { class: classes, multiple: (true if multiple?), include_blank: !multiple? }.compact
55
+ { class: classes, multiple: (true if multiple?), include_blank: (true if include_blank?) }.compact
56
56
  end
57
57
 
58
58
  private
59
59
 
60
+ def include_blank?
61
+ return @include_blank unless @include_blank.nil?
62
+ @include_blank = (options.key?(:include_blank) ? options.delete(:include_blank) : true) && !multiple?
63
+ end
64
+
60
65
  def multiple?
61
66
  return @multiple unless @multiple.nil?
62
67
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
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: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2018-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails