chosen-rails 1.4.1 → 1.4.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: 54b231f0aa24b8fc17fd9a9d54d8464bbfd05303
4
- data.tar.gz: 467cff16f714c0c296cd038e3e859b070e6b1805
3
+ metadata.gz: 7e7dcf4ee04dd591bc754086d22b00cd98e30c0f
4
+ data.tar.gz: 2c92ae378daf8d0990d4c9f61adf83fbcefa336d
5
5
  SHA512:
6
- metadata.gz: 32ff81721fc53de4f563c8aa3c61d75f6992d46f57053d523eb21de5a1b708df651656f5b1b76eedb086f98a10f5d2a44717c3589a77d05a062e5baf66e651ff
7
- data.tar.gz: 13edc3f00dde02e5cf65c3aa38c198e1b9c5bd33baba537ec4890af3a7b8bdc073cb766e3252361adb46f8166feffa947c76fe4367cc0440b8894dff25d65347
6
+ metadata.gz: 42f9e64c9d81d198ced7f727ef845d0fd04d9cb287e31837beb3007d9f2c84e124bc8526824ca2d61e1497c12e9d9e0d2a68e4402916220012a66c1815f0a1c8
7
+ data.tar.gz: 83567e2a64a8abe475941126158a765fa21a47711d8cd446aee3e8fedaac5d626b790d873039b00533de30c2512ac4328c25673fd519c9f2fe410f9bb1e63901
data/chosen-rails.gemspec CHANGED
@@ -14,11 +14,18 @@ Gem::Specification.new do |gem|
14
14
  gem.name = 'chosen-rails'
15
15
  gem.require_paths = ['lib']
16
16
  gem.version = Chosen::Rails::VERSION
17
+ gem.license = 'MIT'
17
18
 
18
19
  gem.add_dependency 'railties', '>= 3.0'
19
20
  gem.add_dependency 'coffee-rails', '>= 3.2'
20
21
  gem.add_dependency 'sass-rails', '>= 3.2'
21
- gem.add_dependency 'compass-rails', '>= 1.1.2'
22
+
23
+ # compass-rails does not yet support sprockets >= 3
24
+ if defined?(Rails) and Gem::Dependency.new('railties', '~> 3.0').match?('railties', Rails.version)
25
+ gem.add_dependency 'compass-rails', '>= 1.1.2'
26
+ else
27
+ gem.add_dependency 'compass-rails', '>= 2.0.4'
28
+ end
22
29
 
23
30
  gem.add_development_dependency 'bundler', '>= 1.0'
24
31
  gem.add_development_dependency 'rails', '>= 3.0'
@@ -1,6 +1,6 @@
1
1
  module Chosen
2
2
  module Rails
3
- VERSION = '1.4.1'
4
- CHOSEN_VERSION = '1.4.1'
3
+ VERSION = '1.4.2'
4
+ CHOSEN_VERSION = '1.4.2'
5
5
  end
6
6
  end
@@ -42,7 +42,7 @@ class Chosen extends AbstractChosen
42
42
  if @is_multiple
43
43
  @container.html '<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + @default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'
44
44
  else
45
- @container.html '<a class="chosen-single chosen-default" tabindex="-1"><span>' + @default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'
45
+ @container.html '<a class="chosen-single chosen-default"><span>' + @default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'
46
46
 
47
47
  @form_field_jq.hide().after @container
48
48
  @dropdown = @container.find('div.chosen-drop').first()
@@ -345,6 +345,8 @@ class Chosen extends AbstractChosen
345
345
  else
346
346
  this.reset_single_select_options()
347
347
 
348
+ high.addClass("result-selected")
349
+
348
350
  item = @results_data[ high[0].getAttribute("data-option-array-index") ]
349
351
  item.selected = true
350
352
 
@@ -357,8 +359,7 @@ class Chosen extends AbstractChosen
357
359
  this.single_set_selected_text(this.choice_label(item))
358
360
 
359
361
  this.results_hide() unless (evt.metaKey or evt.ctrlKey) and @is_multiple
360
-
361
- @search_field.val ""
362
+ this.show_search_field_default()
362
363
 
363
364
  @form_field_jq.trigger "change", {'selected': @form_field.options[item.options_index].value} if @is_multiple || @form_field.selectedIndex != @current_selectedIndex
364
365
  @current_selectedIndex = @form_field.selectedIndex
@@ -8,7 +8,7 @@ class @Chosen extends AbstractChosen
8
8
  super()
9
9
 
10
10
  # HTML Templates
11
- @single_temp = new Template('<a class="chosen-single chosen-default" tabindex="-1"><span>#{default}</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>')
11
+ @single_temp = new Template('<a class="chosen-single chosen-default"><span>#{default}</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>')
12
12
  @multi_temp = new Template('<ul class="chosen-choices"><li class="search-field"><input type="text" value="#{default}" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>')
13
13
  @no_results_temp = new Template('<li class="no-results">' + @results_none_found + ' "<span>#{terms}</span>"</li>')
14
14
 
@@ -352,8 +352,7 @@ class @Chosen extends AbstractChosen
352
352
  this.single_set_selected_text(this.choice_label(item))
353
353
 
354
354
  this.results_hide() unless (evt.metaKey or evt.ctrlKey) and @is_multiple
355
-
356
- @search_field.value = ""
355
+ this.show_search_field_default()
357
356
 
358
357
  @form_field.simulate("change") if typeof Event.simulate is 'function' && (@is_multiple || @form_field.selectedIndex != @current_selectedIndex)
359
358
  @current_selectedIndex = @form_field.selectedIndex
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.1
4
+ version: 1.4.2
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-03-11 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.2
61
+ version: 2.0.4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.1.2
68
+ version: 2.0.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +139,8 @@ files:
139
139
  - vendor/assets/javascripts/lib/select-parser.coffee
140
140
  - vendor/assets/stylesheets/chosen.scss
141
141
  homepage: https://github.com/tsechingho/chosen-rails
142
- licenses: []
142
+ licenses:
143
+ - MIT
143
144
  metadata: {}
144
145
  post_install_message:
145
146
  rdoc_options: []