Skip to content

Commit

Permalink
Merge pull request harvesthq#1924 from harvesthq/gh1914-allow-init-wi…
Browse files Browse the repository at this point in the history
…th-data-attribute

Verify that chosen is instanceof Chosen, fixes harvesthq#1914
  • Loading branch information
stof committed May 5, 2014
2 parents 294ed2d + dd22ea0 commit 34e63df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ $.fn.extend({
this.each (input_field) ->
$this = $ this
chosen = $this.data('chosen')
if options is 'destroy' && chosen
if options is 'destroy' && chosen instanceof Chosen
chosen.destroy()
else unless chosen
else unless chosen instanceof Chosen
$this.data('chosen', new Chosen(this, options))

return
Expand Down

0 comments on commit 34e63df

Please # to comment.