fire a liszt:ready event when Chosen is done generating the HTML, thus providing a hook for further customization

This commit is contained in:
Sebastian Delmont 2011-08-05 12:25:33 -04:00
parent b7a531f211
commit 3bf68f6aef
6 changed files with 12 additions and 6 deletions

View file

@ -89,7 +89,10 @@
}); });
} }
this.results_build(); this.results_build();
return this.set_tab_index(); this.set_tab_index();
return this.form_field_jq.fire("liszt:ready", {
chosen: this
});
}; };
Chosen.prototype.register_observers = function() { Chosen.prototype.register_observers = function() {
this.container.click(__bind(function(evt) { this.container.click(__bind(function(evt) {

File diff suppressed because one or more lines are too long

View file

@ -83,7 +83,10 @@
}); });
} }
this.results_build(); this.results_build();
return this.set_tab_index(); this.set_tab_index();
return this.form_field.fire("liszt:ready", {
chosen: this
});
}; };
Chosen.prototype.register_observers = function() { Chosen.prototype.register_observers = function() {
this.container.observe("click", __bind(function(evt) { this.container.observe("click", __bind(function(evt) {

File diff suppressed because one or more lines are too long

View file

@ -84,7 +84,7 @@ class Chosen
this.results_build() this.results_build()
this.set_tab_index() this.set_tab_index()
@form_field_jq.fire("liszt:ready", {chosen: this})
register_observers: -> register_observers: ->
@container.click (evt) => this.container_click(evt) @container.click (evt) => this.container_click(evt)

View file

@ -78,7 +78,7 @@ class Chosen
this.results_build() this.results_build()
this.set_tab_index() this.set_tab_index()
@form_field.fire("liszt:ready", {chosen: this})
register_observers: -> register_observers: ->
@container.observe "click", (evt) => this.container_click(evt) @container.observe "click", (evt) => this.container_click(evt)