Example #1
0
  /**
   * @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;
  }
Example #2
0
 Utils.addListener(this.barDom, Utils.animationEndEvents, () => {
   if (this.options.force) {
     Utils.remove(this.barDom);
   } else {
     API.ghostFix(this);
   }
   API.closeFlow(this);
 });
Example #3
0
File: index.js Project: needim/noty
 this.promises.close.then(() => {
   API.closeFlow(this)
   API.handleModalClose(this)
 })