Skip to content

Commit 6e01e4e

Browse files
committed
Merge pull request harvesthq#2446 from yallups/do-not-initialize-on-destroy
Fixes harvesthq#2095
2 parents ed446dc + 9e63172 commit 6e01e4e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

coffee/chosen.jquery.coffee

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ $.fn.extend({
88
this.each (input_field) ->
99
$this = $ this
1010
chosen = $this.data('chosen')
11-
if options is 'destroy' && chosen instanceof Chosen
12-
chosen.destroy()
13-
else unless chosen instanceof Chosen
11+
if options is 'destroy'
12+
if chosen instanceof Chosen
13+
chosen.destroy()
14+
return
15+
unless chosen instanceof Chosen
1416
$this.data('chosen', new Chosen(this, options))
1517

1618
return

0 commit comments

Comments
 (0)