vendor/assets/javascripts/chosen.proto.coffee in chosen-rails-1.0.0 vs vendor/assets/javascripts/chosen.proto.coffee in chosen-rails-1.0.1
- old
+ new
@@ -302,12 +302,12 @@
link.up('li').remove()
this.search_field_scale()
results_reset: ->
+ this.reset_single_select_options()
@form_field.options[0].selected = true
- @selected_option_count = null
this.single_set_selected_text()
this.show_search_field_default()
this.results_reset_cleanup()
@form_field.simulate("change") if typeof Event.simulate is 'function'
this.results_hide() if @active_field
@@ -327,15 +327,10 @@
return false
if @is_multiple
high.removeClassName("active-result")
else
- if @result_single_selected
- @result_single_selected.removeClassName("result-selected")
- selected_index = @result_single_selected.getAttribute('data-option-array-index')
- @results_data[selected_index].selected = false
-
- @result_single_selected = high
+ this.reset_single_select_options()
high.addClassName("result-selected")
item = @results_data[ high.getAttribute("data-option-array-index") ]
item.selected = true