From dd22ea0eaed4dacd1add9618405293d20ddf8bd2 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Mon, 5 May 2014 15:13:30 +0200 Subject: [PATCH] verify that chosen is instanceof Chosen, fixes #1914 --- coffee/chosen.jquery.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coffee/chosen.jquery.coffee b/coffee/chosen.jquery.coffee index 574148559fe..6ebcfbd8703 100644 --- a/coffee/chosen.jquery.coffee +++ b/coffee/chosen.jquery.coffee @@ -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