When using allow_single_deselect, first element must have blank text.

abstract-chosen^2
Patrick Filler 2011-09-28 11:46:36 -04:00
parent 5a783bbb96
commit eb2636838e
6 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@
this.results_showing = false;
this.result_highlighted = null;
this.result_single_selected = null;
this.allow_single_deselect = this.options.allow_single_deselect || false;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.choices = 0;
return this.results_none_found = this.options.no_results_text || "No results match";
};

File diff suppressed because one or more lines are too long

View File

@ -38,7 +38,7 @@
this.results_showing = false;
this.result_highlighted = null;
this.result_single_selected = null;
this.allow_single_deselect = this.options.allow_single_deselect || false;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.choices = 0;
this.results_none_found = this.options.no_results_text || "No results match";
this.single_temp = new Template('<a href="javascript:void(0)" class="chzn-single"><span>#{default}</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@ class Chosen
@results_showing = false
@result_highlighted = null
@result_single_selected = null
@allow_single_deselect = @options.allow_single_deselect || false
@allow_single_deselect = if @options.allow_single_deselect? and @form_field.options[0].text == "" then @options.allow_single_deselect else false
@choices = 0
@results_none_found = @options.no_results_text or "No results match"

View File

@ -29,7 +29,7 @@ class Chosen
@results_showing = false
@result_highlighted = null
@result_single_selected = null
@allow_single_deselect = @options.allow_single_deselect || false
@allow_single_deselect = if @options.allow_single_deselect? and @form_field.options[0].text == "" then @options.allow_single_deselect else false
@choices = 0
@results_none_found = @options.no_results_text or "No results match"