Skip to content

Commit

Permalink
Fix #25 - Button binding within buttonset binding breaks on destroy d…
Browse files Browse the repository at this point in the history
…omNodeDisposal.

Signed-off-by: Jonathan Horowitz <[email protected]>
  • Loading branch information
Invader444 committed Apr 6, 2017
1 parent 6476aa0 commit 686264f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dist/amd/bindingHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ define(

// handle disposal
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
$(element)[widgetName]('destroy');
if ($.data(element, widgetName)) {
$(element)[widgetName]('destroy');
}
});

return { controlsDescendantBindings: shouldApplyBindingsToDescendants };
Expand Down
Loading

0 comments on commit 686264f

Please sign in to comment.