Skip to content

Commit

Permalink
Timing of 'chosen:showing_dropdown' fixed
Browse files Browse the repository at this point in the history
Currently the event is triggered before dropdown LI's
are created. This commit corrects it by moving the
trigger event at end of method. A JSFIDDLE was created
to demonstrate the issue.

http://jsfiddle.net/lagrz/3A5jq/

By moving the event it enables developers to add
whatever additional code or styling to the dropdown
menu options such as images.
  • Loading branch information
lagrz authored and pfiller committed Aug 15, 2013
1 parent 5eac8bc commit 3246598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coffee/chosen.jquery.coffee
Expand Up @@ -224,14 +224,14 @@ class Chosen extends AbstractChosen
return false

@container.addClass "chosen-with-drop"
@form_field_jq.trigger("chosen:showing_dropdown", {chosen: this})

@results_showing = true

@search_field.focus()
@search_field.val @search_field.val()

this.winnow_results()
@form_field_jq.trigger("chosen:showing_dropdown", {chosen: this})

update_results_content: (content) ->
@search_results.html content
Expand Down

0 comments on commit 3246598

Please sign in to comment.