Highlight the selected result only if it's active (matches the current search)
This commit is contained in:
parent
ada808db43
commit
93dbe8efec
|
@ -11,7 +11,8 @@
|
||||||
/*
|
/*
|
||||||
Chosen source: generate output using 'cake build'
|
Chosen source: generate output using 'cake build'
|
||||||
Copyright (c) 2011 by Harvest
|
Copyright (c) 2011 by Harvest
|
||||||
*/ var $, Chosen, get_side_border_padding, root;
|
*/
|
||||||
|
var $, Chosen, get_side_border_padding, root;
|
||||||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||||
root = this;
|
root = this;
|
||||||
$ = jQuery;
|
$ = jQuery;
|
||||||
|
@ -542,7 +543,7 @@
|
||||||
Chosen.prototype.winnow_results_set_highlight = function() {
|
Chosen.prototype.winnow_results_set_highlight = function() {
|
||||||
var do_high, selected_results;
|
var do_high, selected_results;
|
||||||
if (!this.result_highlight) {
|
if (!this.result_highlight) {
|
||||||
selected_results = !this.is_multiple ? this.search_results.find(".result-selected") : [];
|
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
||||||
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
||||||
if (do_high != null) {
|
if (do_high != null) {
|
||||||
return this.result_do_highlight(do_high);
|
return this.result_do_highlight(do_high);
|
||||||
|
|
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
|
@ -11,7 +11,8 @@
|
||||||
/*
|
/*
|
||||||
Chosen source: generate output using 'cake build'
|
Chosen source: generate output using 'cake build'
|
||||||
Copyright (c) 2011 by Harvest
|
Copyright (c) 2011 by Harvest
|
||||||
*/ var Chosen, get_side_border_padding, root;
|
*/
|
||||||
|
var Chosen, get_side_border_padding, root;
|
||||||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||||
root = this;
|
root = this;
|
||||||
Chosen = (function() {
|
Chosen = (function() {
|
||||||
|
@ -535,7 +536,7 @@
|
||||||
var do_high;
|
var do_high;
|
||||||
if (!this.result_highlight) {
|
if (!this.result_highlight) {
|
||||||
if (!this.is_multiple) {
|
if (!this.is_multiple) {
|
||||||
do_high = this.search_results.down(".result-selected");
|
do_high = this.search_results.down(".result-selected.active-result");
|
||||||
}
|
}
|
||||||
if (!(do_high != null)) {
|
if (!(do_high != null)) {
|
||||||
do_high = this.search_results.down(".active-result");
|
do_high = this.search_results.down(".active-result");
|
||||||
|
|
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
|
@ -462,7 +462,7 @@ class Chosen
|
||||||
winnow_results_set_highlight: ->
|
winnow_results_set_highlight: ->
|
||||||
if not @result_highlight
|
if not @result_highlight
|
||||||
|
|
||||||
selected_results = if not @is_multiple then @search_results.find(".result-selected") else []
|
selected_results = if not @is_multiple then @search_results.find(".result-selected.active-result") else []
|
||||||
do_high = if selected_results.length then selected_results.first() else @search_results.find(".active-result").first()
|
do_high = if selected_results.length then selected_results.first() else @search_results.find(".active-result").first()
|
||||||
|
|
||||||
this.result_do_highlight do_high if do_high?
|
this.result_do_highlight do_high if do_high?
|
||||||
|
|
|
@ -458,7 +458,7 @@ class Chosen
|
||||||
if not @result_highlight
|
if not @result_highlight
|
||||||
|
|
||||||
if not @is_multiple
|
if not @is_multiple
|
||||||
do_high = @search_results.down(".result-selected")
|
do_high = @search_results.down(".result-selected.active-result")
|
||||||
|
|
||||||
if not do_high?
|
if not do_high?
|
||||||
do_high = @search_results.down(".active-result")
|
do_high = @search_results.down(".active-result")
|
||||||
|
|
Loading…
Reference in a new issue