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 = this.result_highlight;
|
||||||
high_id = high.attr("id");
|
high_id = high.attr("id");
|
||||||
this.result_clear_highlight();
|
this.result_clear_highlight();
|
||||||
high.addClass("result-selected");
|
|
||||||
if (this.is_multiple) {
|
if (this.is_multiple) {
|
||||||
this.result_deactivate(high);
|
this.result_deactivate(high);
|
||||||
} else {
|
} else {
|
||||||
|
this.search_results.find(".result-selected").removeClass("result-selected");
|
||||||
this.result_single_selected = high;
|
this.result_single_selected = high;
|
||||||
}
|
}
|
||||||
|
high.addClass("result-selected");
|
||||||
position = high_id.substr(high_id.lastIndexOf("_") + 1);
|
position = high_id.substr(high_id.lastIndexOf("_") + 1);
|
||||||
item = this.results_data[position];
|
item = this.results_data[position];
|
||||||
item.selected = true;
|
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) {
|
if (this.result_highlight) {
|
||||||
high = this.result_highlight;
|
high = this.result_highlight;
|
||||||
this.result_clear_highlight();
|
this.result_clear_highlight();
|
||||||
high.addClassName("result-selected");
|
|
||||||
if (this.is_multiple) {
|
if (this.is_multiple) {
|
||||||
this.result_deactivate(high);
|
this.result_deactivate(high);
|
||||||
} else {
|
} else {
|
||||||
|
this.search_results.descendants(".result-selected").invoke("removeClassName", "result-selected");
|
||||||
this.result_single_selected = high;
|
this.result_single_selected = high;
|
||||||
}
|
}
|
||||||
|
high.addClassName("result-selected");
|
||||||
position = high.id.substr(high.id.lastIndexOf("_") + 1);
|
position = high.id.substr(high.id.lastIndexOf("_") + 1);
|
||||||
item = this.results_data[position];
|
item = this.results_data[position];
|
||||||
item.selected = true;
|
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()
|
this.result_clear_highlight()
|
||||||
|
|
||||||
high.addClass "result-selected"
|
|
||||||
|
|
||||||
if @is_multiple
|
if @is_multiple
|
||||||
this.result_deactivate high
|
this.result_deactivate high
|
||||||
else
|
else
|
||||||
|
@search_results.find(".result-selected").removeClass "result-selected"
|
||||||
@result_single_selected = high
|
@result_single_selected = high
|
||||||
|
|
||||||
|
high.addClass "result-selected"
|
||||||
|
|
||||||
position = high_id.substr(high_id.lastIndexOf("_") + 1 )
|
position = high_id.substr(high_id.lastIndexOf("_") + 1 )
|
||||||
item = @results_data[position]
|
item = @results_data[position]
|
||||||
item.selected = true
|
item.selected = true
|
||||||
|
|
|
@ -352,13 +352,14 @@ class Chosen
|
||||||
high = @result_highlight
|
high = @result_highlight
|
||||||
this.result_clear_highlight()
|
this.result_clear_highlight()
|
||||||
|
|
||||||
high.addClassName("result-selected")
|
|
||||||
|
|
||||||
if @is_multiple
|
if @is_multiple
|
||||||
this.result_deactivate high
|
this.result_deactivate high
|
||||||
else
|
else
|
||||||
|
@search_results.descendants(".result-selected").invoke "removeClassName", "result-selected"
|
||||||
@result_single_selected = high
|
@result_single_selected = high
|
||||||
|
|
||||||
|
high.addClassName("result-selected")
|
||||||
|
|
||||||
position = high.id.substr(high.id.lastIndexOf("_") + 1 )
|
position = high.id.substr(high.id.lastIndexOf("_") + 1 )
|
||||||
item = @results_data[position]
|
item = @results_data[position]
|
||||||
item.selected = true
|
item.selected = true
|
||||||
|
|
Loading…
Reference in a new issue