chosen-rails 1.8.3 → 1.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +1 -0
- data/lib/chosen-rails/rspec.rb +1 -0
- data/lib/chosen-rails/source_file.rb +6 -0
- data/lib/chosen-rails/version.rb +2 -2
- data/vendor/assets/javascripts/chosen.jquery.coffee +5 -9
- data/vendor/assets/javascripts/chosen.proto.coffee +5 -9
- data/vendor/assets/javascripts/lib/abstract-chosen.coffee +5 -5
- data/vendor/assets/stylesheets/chosen-base.scss +7 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5c19217ddd35b9869cad0624eaf45909a73d27f942861c3cf6218814d8ef0bcc
|
4
|
+
data.tar.gz: bd94b35268e11a25115f136d31f121059337ee7794d87eb85bea3364c94db06f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64e45ca0173cda5d16fc7d63a87294745b381156469ca9b1af6e6f2ad7f985d72a4125c3ac561f635a2afc30a4fe57e286ca77d7ca38bbbc0fc940e46b99d07e
|
7
|
+
data.tar.gz: 6836a1e3511aaabd044dbb2cdbb6b77fde7a6a2d35602a70ccf05dba4dd1261af9d145620e831f788308180b5ad0ac4f2aba127bf7f9ce8815ad8bb6a6629b96
|
data/Rakefile
CHANGED
data/lib/chosen-rails/rspec.rb
CHANGED
@@ -49,6 +49,12 @@ class SourceFile < Thor
|
|
49
49
|
prepend_to_file 'stylesheets/chosen-base.scss', scss
|
50
50
|
end
|
51
51
|
|
52
|
+
desc 'change url to image url', 'change url to image url'
|
53
|
+
def change_url_to_image_url
|
54
|
+
self.destination_root = 'vendor/assets'
|
55
|
+
gsub_file 'stylesheets/chosen-base.scss', /url/, 'image-url'
|
56
|
+
end
|
57
|
+
|
52
58
|
desc 'clean up useless files', 'clean up useless files'
|
53
59
|
def cleanup
|
54
60
|
self.destination_root = 'vendor/assets'
|
data/lib/chosen-rails/version.rb
CHANGED
@@ -243,9 +243,6 @@ class Chosen extends AbstractChosen
|
|
243
243
|
@form_field_jq.trigger("chosen:maxselected", {chosen: this})
|
244
244
|
return false
|
245
245
|
|
246
|
-
unless @is_multiple
|
247
|
-
@search_container.append @search_field
|
248
|
-
|
249
246
|
@container.addClass "chosen-with-drop"
|
250
247
|
@results_showing = true
|
251
248
|
|
@@ -262,10 +259,6 @@ class Chosen extends AbstractChosen
|
|
262
259
|
if @results_showing
|
263
260
|
this.result_clear_highlight()
|
264
261
|
|
265
|
-
unless @is_multiple
|
266
|
-
@selected_item.prepend @search_field
|
267
|
-
@search_field.focus()
|
268
|
-
|
269
262
|
@container.removeClass "chosen-with-drop"
|
270
263
|
@form_field_jq.trigger("chosen:hiding_dropdown", {chosen: this})
|
271
264
|
|
@@ -373,7 +366,6 @@ class Chosen extends AbstractChosen
|
|
373
366
|
|
374
367
|
@form_field.options[item.options_index].selected = true
|
375
368
|
@selected_option_count = null
|
376
|
-
@search_field.val("")
|
377
369
|
|
378
370
|
if @is_multiple
|
379
371
|
this.choice_build item
|
@@ -381,7 +373,11 @@ class Chosen extends AbstractChosen
|
|
381
373
|
this.single_set_selected_text(this.choice_label(item))
|
382
374
|
|
383
375
|
if @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey))
|
384
|
-
|
376
|
+
if evt.metaKey or evt.ctrlKey
|
377
|
+
this.winnow_results(skip_highlight: true)
|
378
|
+
else
|
379
|
+
@search_field.val("")
|
380
|
+
this.winnow_results()
|
385
381
|
else
|
386
382
|
this.results_hide()
|
387
383
|
this.show_search_field_default()
|
@@ -235,9 +235,6 @@ class @Chosen extends AbstractChosen
|
|
235
235
|
@form_field.fire("chosen:maxselected", {chosen: this})
|
236
236
|
return false
|
237
237
|
|
238
|
-
unless @is_multiple
|
239
|
-
@search_container.insert @search_field
|
240
|
-
|
241
238
|
@container.addClassName "chosen-with-drop"
|
242
239
|
@results_showing = true
|
243
240
|
|
@@ -254,10 +251,6 @@ class @Chosen extends AbstractChosen
|
|
254
251
|
if @results_showing
|
255
252
|
this.result_clear_highlight()
|
256
253
|
|
257
|
-
unless @is_multiple
|
258
|
-
@selected_item.insert top: @search_field
|
259
|
-
@search_field.focus()
|
260
|
-
|
261
254
|
@container.removeClassName "chosen-with-drop"
|
262
255
|
@form_field.fire("chosen:hiding_dropdown", {chosen: this})
|
263
256
|
|
@@ -365,7 +358,6 @@ class @Chosen extends AbstractChosen
|
|
365
358
|
|
366
359
|
@form_field.options[item.options_index].selected = true
|
367
360
|
@selected_option_count = null
|
368
|
-
@search_field.value = ""
|
369
361
|
|
370
362
|
if @is_multiple
|
371
363
|
this.choice_build item
|
@@ -373,7 +365,11 @@ class @Chosen extends AbstractChosen
|
|
373
365
|
this.single_set_selected_text(this.choice_label(item))
|
374
366
|
|
375
367
|
if @is_multiple && (!@hide_results_on_select || (evt.metaKey or evt.ctrlKey))
|
376
|
-
|
368
|
+
if evt.metaKey or evt.ctrlKey
|
369
|
+
this.winnow_results(skip_highlight: true)
|
370
|
+
else
|
371
|
+
@search_field.value = ""
|
372
|
+
this.winnow_results()
|
377
373
|
else
|
378
374
|
this.results_hide()
|
379
375
|
this.show_search_field_default()
|
@@ -51,7 +51,7 @@ class AbstractChosen
|
|
51
51
|
|
52
52
|
choice_label: (item) ->
|
53
53
|
if @include_group_label_in_selected and item.group_label?
|
54
|
-
"<b class='group-name'>#{item.group_label}</b>#{item.html}"
|
54
|
+
"<b class='group-name'>#{this.escape_html(item.group_label)}</b>#{item.html}"
|
55
55
|
else
|
56
56
|
item.html
|
57
57
|
|
@@ -114,7 +114,7 @@ class AbstractChosen
|
|
114
114
|
|
115
115
|
option_el = document.createElement("li")
|
116
116
|
option_el.className = classes.join(" ")
|
117
|
-
option_el.style.cssText = option.style
|
117
|
+
option_el.style.cssText = option.style if option.style
|
118
118
|
option_el.setAttribute("data-option-array-index", option.array_index)
|
119
119
|
option_el.innerHTML = option.highlighted_html or option.html
|
120
120
|
option_el.title = option.title if option.title
|
@@ -159,7 +159,7 @@ class AbstractChosen
|
|
159
159
|
else
|
160
160
|
this.results_show()
|
161
161
|
|
162
|
-
winnow_results: ->
|
162
|
+
winnow_results: (options) ->
|
163
163
|
this.no_results_clear()
|
164
164
|
|
165
165
|
results = 0
|
@@ -214,7 +214,7 @@ class AbstractChosen
|
|
214
214
|
this.no_results query
|
215
215
|
else
|
216
216
|
this.update_results_content this.results_option_build()
|
217
|
-
this.winnow_results_set_highlight()
|
217
|
+
this.winnow_results_set_highlight() unless options?.skip_highlight
|
218
218
|
|
219
219
|
get_search_regex: (escaped_search_string) ->
|
220
220
|
regex_string = if @search_contains then escaped_search_string else "(^|\\s|\\b)#{escaped_search_string}[^\\s]*"
|
@@ -332,12 +332,12 @@ class AbstractChosen
|
|
332
332
|
get_single_html: ->
|
333
333
|
"""
|
334
334
|
<a class="chosen-single chosen-default">
|
335
|
-
<input class="chosen-search-input" type="text" autocomplete="off" />
|
336
335
|
<span>#{@default_text}</span>
|
337
336
|
<div><b></b></div>
|
338
337
|
</a>
|
339
338
|
<div class="chosen-drop">
|
340
339
|
<div class="chosen-search">
|
340
|
+
<input class="chosen-search-input" type="text" autocomplete="off" />
|
341
341
|
</div>
|
342
342
|
<ul class="chosen-results"></ul>
|
343
343
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
//= depend_on_asset "chosen-sprite.png"
|
2
2
|
//= depend_on_asset "chosen-sprite@2x.png"
|
3
|
-
$chosen-sprite: url('chosen-sprite.png') !default;
|
4
|
-
$chosen-sprite-retina: url('chosen-sprite@2x.png') !default;
|
3
|
+
$chosen-sprite: image-url('chosen-sprite.png') !default;
|
4
|
+
$chosen-sprite-retina: image-url('chosen-sprite@2x.png') !default;
|
5
5
|
|
6
6
|
/* @group Base */
|
7
7
|
.chosen-container {
|
@@ -22,10 +22,12 @@ $chosen-sprite-retina: url('chosen-sprite@2x.png') !default;
|
|
22
22
|
border-top: 0;
|
23
23
|
background: #fff;
|
24
24
|
box-shadow: 0 4px 5px rgba(#000,.15);
|
25
|
-
|
25
|
+
clip: rect(0,0,0,0);
|
26
|
+
clip-path: inset(100% 100%);
|
26
27
|
}
|
27
28
|
&.chosen-with-drop .chosen-drop {
|
28
|
-
|
29
|
+
clip: auto;
|
30
|
+
clip-path: none;
|
29
31
|
}
|
30
32
|
a{
|
31
33
|
cursor: pointer;
|
@@ -67,12 +69,6 @@ $chosen-sprite-retina: url('chosen-sprite@2x.png') !default;
|
|
67
69
|
text-decoration: none;
|
68
70
|
white-space: nowrap;
|
69
71
|
line-height: 24px;
|
70
|
-
|
71
|
-
input[type="text"] {
|
72
|
-
cursor: pointer;
|
73
|
-
opacity: 0;
|
74
|
-
position: absolute;
|
75
|
-
}
|
76
72
|
}
|
77
73
|
.chosen-default {
|
78
74
|
color: #999;
|
@@ -146,6 +142,7 @@ $chosen-sprite-retina: url('chosen-sprite@2x.png') !default;
|
|
146
142
|
&.chosen-container-single-nosearch .chosen-search {
|
147
143
|
position: absolute;
|
148
144
|
clip: rect(0,0,0,0);
|
145
|
+
clip-path: inset(100% 100%);
|
149
146
|
}
|
150
147
|
}
|
151
148
|
/* @end */
|
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.8.
|
4
|
+
version: 1.8.7
|
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: 2018-
|
11
|
+
date: 2018-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.6
|
150
|
+
rubygems_version: 2.7.6
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Integrate Chosen javascript library with Rails asset pipeline
|