chosen-rails 1.4.2 → 1.4.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: 7e7dcf4ee04dd591bc754086d22b00cd98e30c0f
4
- data.tar.gz: 2c92ae378daf8d0990d4c9f61adf83fbcefa336d
3
+ metadata.gz: a826802b6b2da40d23e07924bf90ab5c02284488
4
+ data.tar.gz: 933c17475b7393f91d0c9e43118a365f7a7e786e
5
5
  SHA512:
6
- metadata.gz: 42f9e64c9d81d198ced7f727ef845d0fd04d9cb287e31837beb3007d9f2c84e124bc8526824ca2d61e1497c12e9d9e0d2a68e4402916220012a66c1815f0a1c8
7
- data.tar.gz: 83567e2a64a8abe475941126158a765fa21a47711d8cd446aee3e8fedaac5d626b790d873039b00533de30c2512ac4328c25673fd519c9f2fe410f9bb1e63901
6
+ metadata.gz: 9ccb7fa379d3d0a373fe3fa48e700d8df8906576558b383eba378bf58308a5daca848adbc63e3bb0856b41d5844a2f89ed1cc092ba7587abed0b8048ec4684f2
7
+ data.tar.gz: f1fbdbb0317eb4077deaa41eace59496802c39db10df61630491395644c56377de58e8788070ce0352408eda356bb82e13e4c5c6a29162f241fc7f65f18d8745
@@ -6,6 +6,6 @@ task 'assets:precompile' do
6
6
  Dir['public/assets/chosen-*'].each do |file|
7
7
  next unless file =~ fingerprint
8
8
  nondigest = file.sub fingerprint, '.'
9
- FileUtils.cp file, nondigest, verbose: true
9
+ FileUtils.copy_entry file, nondigest, remove_destination: true
10
10
  end
11
11
  end
@@ -1,6 +1,6 @@
1
1
  module Chosen
2
2
  module Rails
3
- VERSION = '1.4.2'
3
+ VERSION = '1.4.3'
4
4
  CHOSEN_VERSION = '1.4.2'
5
5
  end
6
6
  end
@@ -32,6 +32,7 @@ class AbstractChosen
32
32
  @display_selected_options = if @options.display_selected_options? then @options.display_selected_options else true
33
33
  @display_disabled_options = if @options.display_disabled_options? then @options.display_disabled_options else true
34
34
  @include_group_label_in_selected = @options.include_group_label_in_selected || false
35
+ @max_shown_results = @options.max_shown_results || Number.POSITIVE_INFINITY
35
36
 
36
37
  set_default_text: ->
37
38
  if @form_field.getAttribute("data-placeholder")
@@ -65,11 +66,16 @@ class AbstractChosen
65
66
 
66
67
  results_option_build: (options) ->
67
68
  content = ''
69
+ shown_results = 0
68
70
  for data in @results_data
71
+ data_content = ''
69
72
  if data.group
70
- content += this.result_add_group data
73
+ data_content = this.result_add_group data
71
74
  else
72
- content += this.result_add_option data
75
+ data_content = this.result_add_option data
76
+ if data_content != ''
77
+ shown_results++
78
+ content += data_content
73
79
 
74
80
  # this select logic pins on an awkward flag
75
81
  # we can make it better
@@ -79,6 +85,9 @@ class AbstractChosen
79
85
  else if data.selected and not @is_multiple
80
86
  this.single_set_selected_text(this.choice_label(data))
81
87
 
88
+ if shown_results >= @max_shown_results
89
+ break
90
+
82
91
  content
83
92
 
84
93
  result_add_option: (option) ->
@@ -34,7 +34,7 @@ $chosen-sprite-retina: image-url('chosen-sprite@2x.png') !default;
34
34
  a{
35
35
  cursor: pointer;
36
36
  }
37
-
37
+
38
38
  .search-choice, .chosen-single{
39
39
  .group-name{
40
40
  margin-right: 4px;
@@ -64,7 +64,7 @@ $chosen-sprite-retina: image-url('chosen-sprite@2x.png') !default;
64
64
  border: 1px solid #aaa;
65
65
  border-radius: 5px;
66
66
  background-color: #fff;
67
- @include background(linear-gradient(top, #fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%));
67
+ @include background(linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%));
68
68
  background-clip: padding-box;
69
69
  box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(#000,.1);
70
70
  color: #444;
@@ -275,7 +275,7 @@ $chosen-sprite-retina: image-url('chosen-sprite@2x.png') !default;
275
275
  padding-right: 5px;
276
276
  border: 1px solid #ccc;
277
277
  background-color: #e4e4e4;
278
- @include background-image(linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%));
278
+ @include background-image(linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%));
279
279
  color: #666;
280
280
  }
281
281
  &.search-choice-focus {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chosen-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tse-Ching Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-30 00:00:00.000000000 Z
11
+ date: 2015-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.6
161
+ rubygems_version: 2.4.8
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Integrate Chosen javascript library with Rails asset pipeline