/** * @return {Noty} */ close () { if (this.closed) return this; if (!this.shown) { // it's in the queue API.removeFromQueue(this); return this; } API.fire(this, 'onClose'); if (this.options.animation.close == null) { Utils.remove(this.barDom); API.closeFlow(this); } else if (typeof this.options.animation.close == 'function') { this.options.animation.close.apply(this); API.closeFlow(this); } else { Utils.addClass(this.barDom, this.options.animation.close); Utils.addListener(this.barDom, Utils.animationEndEvents, () => { if (this.options.force) { Utils.remove(this.barDom); } else { API.ghostFix(this); } API.closeFlow(this); }); } this.closed = true; return this; }
Utils.addListener(this.barDom, Utils.animationEndEvents, () => { if (this.options.force) { Utils.remove(this.barDom); } else { API.ghostFix(this); } API.closeFlow(this); });
this.promises.close.then(() => { API.closeFlow(this) API.handleModalClose(this) })