Skip to content

Commit

Permalink
Merge pull request #2717 from koenpunt/unbind-label-click
Browse files Browse the repository at this point in the history
unbind label click
  • Loading branch information
koenpunt authored Oct 11, 2016
2 parents 5285c15 + 435dd2d commit f2fe103
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ class Chosen extends AbstractChosen
@container.bind 'click.chosen', (evt) -> evt.preventDefault(); return # gobble click of anchor

destroy: ->
$(@container[0].ownerDocument).unbind "click.chosen", @click_test_action
$(@container[0].ownerDocument).unbind 'click.chosen', @click_test_action
@form_field_label.unbind 'click.chosen' if @form_field_label.length > 0

if @search_field[0].tabIndex
@form_field_jq[0].tabIndex = @search_field[0].tabIndex

Expand Down
4 changes: 3 additions & 1 deletion coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class @Chosen extends AbstractChosen
destroy: ->
@container.ownerDocument.stopObserving "click", @click_test_action

@form_field.stopObserving()
for event in ['chosen:updated', 'chosen:activate', 'chosen:open', 'chosen:close']
@form_field.stopObserving(event)

@container.stopObserving()
@search_results.stopObserving()
@search_field.stopObserving()
Expand Down

0 comments on commit f2fe103

Please sign in to comment.