Skip to content

Commit

Permalink
Ensure dialogs are closed when removed from DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed May 23, 2017
1 parent 30a5d18 commit 5ff84d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ angular.module('ayDialog', [])
el.addEventListener('cancel', checkUnblockScrolling);

$element.on('$destroy', function() {
if (el.open) {
checkUnblockScrolling();
}

el.removeEventListener('close', checkUnblockScrolling);
el.removeEventListener('cancel', checkUnblockScrolling);
el = null;
Expand Down

0 comments on commit 5ff84d5

Please sign in to comment.