Use coffeescript existential operator and commit js changes.

master
Patrick Filler 2011-11-15 11:01:40 -05:00
parent 9dd4fb51a8
commit 16b6f5047a
5 changed files with 5 additions and 5 deletions

View File

@ -113,7 +113,7 @@
this.results_showing = false;
this.result_highlighted = null;
this.result_single_selected = null;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.disable_search_threshold = this.options.disable_search_threshold || 0;
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

@ -113,7 +113,7 @@
this.results_showing = false;
this.result_highlighted = null;
this.result_single_selected = null;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.disable_search_threshold = this.options.disable_search_threshold || 0;
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

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