Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #520 where IE11 flashed up the modal after close #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions js/ngDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,22 @@
$rootScope.$broadcast('ngDialog.closing', $dialog, value);
dialogsCount = dialogsCount < 0 ? 0 : dialogsCount;
if (animationEndSupport && !options.disableAnimation) {
var isIE = !!window.MSInputMethodContext && !!document.documentMode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting needs to match existing code

scope.$destroy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this scope destroy not be above the isIE declaration?

$dialog.unbind(animationEndEvent).bind(animationEndEvent, function () {
privateMethods.closeDialogElement($dialog, value);
}).addClass('ngdialog-closing');
if (!isIE) {
$dialog.unbind(animationEndEvent).bind(animationEndEvent, function () {
privateMethods.closeDialogElement($dialog, value);
}).addClass('ngdialog-closing');
}
// Awful IE detection due to https://connect.microsoft.com/IE/feedbackdetail/view/1605631/animation-end-events-firing-late
else {
$dialog.addClass('ngdialog-closing');
var duration = window.getComputedStyle($dialog.find(".ngdialog-content")[0]).animationDuration,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes only

dialogAnimationDuration = (0 < duration.indexOf("ms")) ? parseFloat(duration) : parseFloat(duration) * 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes

setTimeout(function () {
privateMethods.closeDialogElement($dialog, value);
}, dialogAnimationDuration);
}
} else {
scope.$destroy();
privateMethods.closeDialogElement($dialog, value);
Expand Down