Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const interval = $interval(function() {
// wait for close animation to finish before destroying
if (!element.hasClass(MDCDialogFoundation.cssClasses.ANIMATING)) {
$interval.cancel(interval);
resolve();
}
}, 10);
}).then(function() {
function hideDialog(action = '') {
this.isOpen_ = false;
this.adapter_.addClass(MDCDialogFoundation.cssClasses.CLOSING);
this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
this.adapter_.removeBodyClass(MDCDialogFoundation.cssClasses.SCROLL_LOCK);
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = 0;
clearTimeout(this.animationTimer_);
this.animationTimer_ = setTimeout(() => {
this.adapter_.releaseFocus();
this.handleAnimationTimerEnd_();
this.adapter_.notifyClosed(action);
}, MDCDialogFoundation.numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);
}
function hideDialog(action = '') {
this.isOpen_ = false;
this.adapter_.addClass(MDCDialogFoundation.cssClasses.CLOSING);
this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
this.adapter_.removeBodyClass(MDCDialogFoundation.cssClasses.SCROLL_LOCK);
cancelAnimationFrame(this.animationFrame_);
this.animationFrame_ = 0;
clearTimeout(this.animationTimer_);
this.animationTimer_ = setTimeout(() => {
this.adapter_.releaseFocus();
this.handleAnimationTimerEnd_();
this.adapter_.notifyClosed(action);
}, MDCDialogFoundation.numbers.DIALOG_ANIMATION_CLOSE_TIME_MS);
}