Prevent duplicate jQuery Chosen calls.

This commit is contained in:
Patrick Filler 2011-07-20 11:29:23 -04:00
parent cb7bf985a0
commit 1dd5100122
2 changed files with 6 additions and 2 deletions

View file

@ -13,7 +13,7 @@ $ = jQuery
$.fn.extend({
chosen: (data, options) ->
$(this).each((input_field) ->
new Chosen(this, data, options)
new Chosen(this, data, options) unless ($ this).hasClass "chzn-done"
)
})
@ -30,6 +30,7 @@ class Chosen
this.set_up_html()
this.register_observers()
@form_field_jq.addClass "chzn-done"
set_default_values: ->