Skip to content
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