If deselecting when Chosen is open, close it up.

abstract-chosen^2
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