Fire the change event when deselecting a value.

This commit is contained in:
Patrick Filler 2011-09-28 13:40:18 -04:00
parent b7a9b218fb
commit 953d3baa4f
6 changed files with 8 additions and 2 deletions

View file

@ -450,6 +450,7 @@
this.selected_item.find("span").text(this.default_text);
this.show_search_field_default();
$(evt.target).remove();
this.form_field_jq.trigger("change");
if (this.active_field) {
return this.results_hide();
}

File diff suppressed because one or more lines are too long

View file

@ -440,6 +440,9 @@
this.selected_item.down("span").update(this.default_text);
this.show_search_field_default();
evt.target.remove();
if (typeof Event.simulate === 'function') {
this.form_field.simulate("change");
}
if (this.active_field) {
return this.results_hide();
}

File diff suppressed because one or more lines are too long

View file

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

View file

@ -359,6 +359,7 @@ class Chosen
@selected_item.down("span").update(@default_text)
this.show_search_field_default()
evt.target.remove()
@form_field.simulate("change") if typeof Event.simulate is 'function'
this.results_hide() if @active_field
result_select: (evt) ->