On single selects, remove the result-selected class from any previously selected options when selecting an option
This commit is contained in:
parent
85c436086f
commit
df394886e4
|
@ -437,12 +437,13 @@
|
|||
high = this.result_highlight;
|
||||
high_id = high.attr("id");
|
||||
this.result_clear_highlight();
|
||||
high.addClass("result-selected");
|
||||
if (this.is_multiple) {
|
||||
this.result_deactivate(high);
|
||||
} else {
|
||||
this.search_results.find(".result-selected").removeClass("result-selected");
|
||||
this.result_single_selected = high;
|
||||
}
|
||||
high.addClass("result-selected");
|
||||
position = high_id.substr(high_id.lastIndexOf("_") + 1);
|
||||
item = this.results_data[position];
|
||||
item.selected = true;
|
||||
|
|
2
chosen/chosen.jquery.min.js
vendored
2
chosen/chosen.jquery.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -424,12 +424,13 @@
|
|||
if (this.result_highlight) {
|
||||
high = this.result_highlight;
|
||||
this.result_clear_highlight();
|
||||
high.addClassName("result-selected");
|
||||
if (this.is_multiple) {
|
||||
this.result_deactivate(high);
|
||||
} else {
|
||||
this.search_results.descendants(".result-selected").invoke("removeClassName", "result-selected");
|
||||
this.result_single_selected = high;
|
||||
}
|
||||
high.addClassName("result-selected");
|
||||
position = high.id.substr(high.id.lastIndexOf("_") + 1);
|
||||
item = this.results_data[position];
|
||||
item.selected = true;
|
||||
|
|
2
chosen/chosen.proto.min.js
vendored
2
chosen/chosen.proto.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -359,13 +359,14 @@ class Chosen
|
|||
|
||||
this.result_clear_highlight()
|
||||
|
||||
high.addClass "result-selected"
|
||||
|
||||
if @is_multiple
|
||||
this.result_deactivate high
|
||||
else
|
||||
@search_results.find(".result-selected").removeClass "result-selected"
|
||||
@result_single_selected = high
|
||||
|
||||
high.addClass "result-selected"
|
||||
|
||||
position = high_id.substr(high_id.lastIndexOf("_") + 1 )
|
||||
item = @results_data[position]
|
||||
item.selected = true
|
||||
|
|
|
@ -352,12 +352,13 @@ class Chosen
|
|||
high = @result_highlight
|
||||
this.result_clear_highlight()
|
||||
|
||||
high.addClassName("result-selected")
|
||||
|
||||
if @is_multiple
|
||||
this.result_deactivate high
|
||||
else
|
||||
@search_results.descendants(".result-selected").invoke "removeClassName", "result-selected"
|
||||
@result_single_selected = high
|
||||
|
||||
high.addClassName("result-selected")
|
||||
|
||||
position = high.id.substr(high.id.lastIndexOf("_") + 1 )
|
||||
item = @results_data[position]
|
||||
|
|
Loading…
Reference in a new issue