simple_form_extension 1.1.1 → 1.1.2

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: dce3e78a64dd2c77636f1d9a891d6863d6da048f
4
- data.tar.gz: d4342009b4702683ce62bbc0382fd3ea27717441
3
+ metadata.gz: c376f924f219d09cb3f166bc1e66f63a08625ae7
4
+ data.tar.gz: 603f99ab5b7be3b18bbfc76da761f8416dcc2cd4
5
5
  SHA512:
6
- metadata.gz: 6e9c2f6d5cb278850a4e5c97152c505ac83251442926e6b98adf16d97a193a1ab6585fbfcc07165132a8ee9db728e669fa5e5e48fe5be9ff18e2e016f9117b4e
7
- data.tar.gz: 5ba0bceafadeeea0fbe1f114c425f5327aa7b043c7ae2d8b1ade47764763749fc2714f15f9eb1a16eab59fc3d6c685cc4049eb0d87e50cd900cc8dd49634e81f
6
+ metadata.gz: 5fe558bb91419b112cfdc8d225f9176e30ed7377cc57db007ef6a8a7fd76059972446cae9b1bd5777bae78ea5ee359abdffe2a8aef001bb72d0d44762f286687
7
+ data.tar.gz: 3a1bce244ca45ebe71526999b193bc9c7b4ffa5dc370973a6ecdec2d82f2251be73c54a63f8e23aee07a53a0b8391882c71ffbce7a35e84b8f9fcb10c311da3e
@@ -21,7 +21,8 @@ module SimpleFormExtension
21
21
  :'creatable' => creatable?,
22
22
  :'multi' => multi?,
23
23
  :'add-translation' => _translate('selectize.add'),
24
- :'collection' => collection
24
+ :'collection' => collection,
25
+ :'max-items' => max_items
25
26
  )
26
27
 
27
28
  @builder.hidden_field attribute_name, input_html_options
@@ -36,6 +37,10 @@ module SimpleFormExtension
36
37
  enumerable?(value)
37
38
  end
38
39
 
40
+ def max_items
41
+ options[:max_items]
42
+ end
43
+
39
44
  def collection
40
45
  if (collection = options[:collection])
41
46
  if enumerable?(collection)
@@ -1,3 +1,3 @@
1
1
  module SimpleFormExtension
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -10,6 +10,7 @@ class Selectize
10
10
 
11
11
  @$el.selectize(
12
12
  mode: if @single then 'single' else 'multi'
13
+ maxItems: if @single then 1 else @$el.data('max-items')
13
14
  sortField: 'text'
14
15
  plugins: ['remove_button']
15
16
  create: creatable
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Vasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-04 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails