Fire the change event when deselecting a value.

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