Skip to content

Commit

Permalink
trigger change event after adding fixes #31 #16
Browse files Browse the repository at this point in the history
  • Loading branch information
koenpunt committed Jun 20, 2013
1 parent 3d042b9 commit 527b1a7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chosen/chosen.jquery.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion chosen/chosen.proto.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ class Chosen extends AbstractChosen
@form_field_jq.append option
terms = @search_field.val()
@form_field_jq.trigger "liszt:updated"
@form_field_jq.trigger "change"
@search_field.trigger('focus')

no_results_clear: ->
Expand Down
1 change: 1 addition & 0 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ class Chosen extends AbstractChosen
option = @new_option_temp.evaluate( options )
@form_field.insert option
Event.fire @form_field, "liszt:updated"
@form_field.simulate("change") if typeof Event.simulate is 'function'
this.result_select()

no_results_clear: ->
Expand Down
1 change: 1 addition & 0 deletions public/chosen.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@
this.form_field_jq.append(option);
terms = this.search_field.val();
this.form_field_jq.trigger("liszt:updated");
this.form_field_jq.trigger("change");
return this.search_field.trigger('focus');
};

Expand Down
3 changes: 3 additions & 0 deletions public/chosen.proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,9 @@
option = this.new_option_temp.evaluate(options);
this.form_field.insert(option);
Event.fire(this.form_field, "liszt:updated");
if (typeof Event.simulate === 'function') {
this.form_field.simulate("change");
}
return this.result_select();
};

Expand Down

0 comments on commit 527b1a7

Please sign in to comment.