If deselecting when Chosen is open, close it up.

This commit is contained in:
Patrick Filler 2011-09-27 16:57:51 -04:00
parent 3b11f2e2d1
commit 81c084ec99
6 changed files with 13 additions and 5 deletions

View file

@ -446,7 +446,10 @@
this.form_field.options[0].selected = true;
this.selected_item.find("span").text(this.default_text);
this.show_search_field_default();
return $(evt.target).remove();
$(evt.target).remove();
if (this.active_field) {
return this.results_hide();
}
};
Chosen.prototype.result_select = function(evt) {
var high, high_id, item, position;

File diff suppressed because one or more lines are too long

View file

@ -434,7 +434,10 @@
this.form_field.options[0].selected = true;
this.selected_item.down("span").update(this.default_text);
this.show_search_field_default();
return evt.target.remove();
evt.target.remove();
if (this.active_field) {
return this.results_hide();
}
};
Chosen.prototype.result_select = function(evt) {
var high, item, position;

File diff suppressed because one or more lines are too long

View file

@ -363,6 +363,7 @@ class Chosen
@selected_item.find("span").text @default_text
this.show_search_field_default()
$(evt.target).remove();
this.results_hide() if @active_field
result_select: (evt) ->
if @result_highlight

View file

@ -357,7 +357,8 @@ class Chosen
@form_field.options[0].selected = true
@selected_item.down("span").update(@default_text)
this.show_search_field_default()
evt.target.remove();
evt.target.remove()
this.results_hide() if @active_field
result_select: (evt) ->
if @result_highlight