Make sure jquery version's update / change events are firing.

This commit is contained in:
Patrick Filler 2011-07-13 15:09:29 -04:00
parent e54e4730cd
commit ea87ad4df3
2 changed files with 4 additions and 6 deletions

View file

@ -418,6 +418,7 @@
} }
this.results_hide(); this.results_hide();
this.search_field.val(""); this.search_field.val("");
($(this.form_field)).trigger("change");
return this.search_field_scale(); return this.search_field_scale();
} }
}; };
@ -436,9 +437,7 @@
result.removeClass("result-selected").addClass("active-result").show(); result.removeClass("result-selected").addClass("active-result").show();
this.result_clear_highlight(); this.result_clear_highlight();
this.winnow_results(); this.winnow_results();
if (typeof Event.simulate === 'function') { ($(this.form_field)).trigger("change");
this.form_field.simulate("change");
}
return this.search_field_scale(); return this.search_field_scale();
}; };
Chosen.prototype.results_search = function(evt) { Chosen.prototype.results_search = function(evt) {

View file

@ -377,8 +377,7 @@ class Chosen
this.results_hide() this.results_hide()
@search_field.val "" @search_field.val ""
# TODO ($ @form_field).trigger "change"
#@form_field.simulate("change") if typeof Event.simulate is 'function'
this.search_field_scale() this.search_field_scale()
result_activate: (el) -> result_activate: (el) ->
@ -398,7 +397,7 @@ class Chosen
this.result_clear_highlight() this.result_clear_highlight()
this.winnow_results() this.winnow_results()
@form_field.simulate("change") if typeof Event.simulate is 'function' ($ @form_field).trigger "change"
this.search_field_scale() this.search_field_scale()
results_search: (evt) -> results_search: (evt) ->