From 5ff84d5a4392e0c203d26de902d3e189342099a8 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 23 May 2017 13:59:19 -0700 Subject: [PATCH] Ensure dialogs are closed when removed from DOM --- dialog.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dialog.js b/dialog.js index 3b6a730..7eeb762 100644 --- a/dialog.js +++ b/dialog.js @@ -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;