How to use the ngx-bootstrap/utils.isBs3 function in ngx-bootstrap

To help you get started, we’ve selected a few ngx-bootstrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github valor-software / ngx-bootstrap / src / modal / modal.directive.ts View on Github external
event.preventDefault();
    }

    this.onHide.emit(this);

    // todo: add an option to prevent hiding
    if (!this._isShown) {
      return;
    }

    clearTimeout(this.timerHideModal);
    clearTimeout(this.timerRmBackDrop);

    this._isShown = false;
    this._renderer.removeClass(this._element.nativeElement, CLASS_NAME.IN);
    if (!isBs3()) {
      this._renderer.removeClass(this._element.nativeElement, CLASS_NAME.SHOW);
    }
    // this._addClassIn = false;

    if (this._config.animated) {
      this.timerHideModal = setTimeout(
        () => this.hideModal(),
        TRANSITION_DURATION
      );
    } else {
      this.hideModal();
    }
  }
github valor-software / ngx-bootstrap / src / modal / modal-container.component.ts View on Github external
hide(): void {
    if (this.isModalHiding || !this.isShown) {
      return;
    }
    this.isModalHiding = true;
    this._renderer.removeClass(
      this._element.nativeElement,
      isBs3() ? CLASS_NAME.IN : CLASS_NAME.SHOW
    );
    setTimeout(() => {
      this.isShown = false;
      if (
        document &&
        document.body &&
        this.bsModalService.getModalsCount() === 1
      ) {
        this._renderer.removeClass(document.body, CLASS_NAME.OPEN);
      }
      this.bsModalService.hide(this.level);
      this.isModalHiding = false;
    }, this.isAnimated ? TRANSITION_DURATIONS.MODAL : 0);
  }
}
github valor-software / ngx-bootstrap / src / modal / modal-backdrop.component.ts View on Github external
set isShown(value: boolean) {
    this._isShown = value;
    if (value) {
      this.renderer.addClass(
        this.element.nativeElement,
        `${CLASS_NAME.IN}`
      );
    } else {
      this.renderer.removeClass(
        this.element.nativeElement,
        `${CLASS_NAME.IN}`
      );
    }
    if (!isBs3()) {
      if (value) {
        this.renderer.addClass(
          this.element.nativeElement,
          `${CLASS_NAME.SHOW}`
        );
      } else {
        this.renderer.removeClass(
          this.element.nativeElement,
          `${CLASS_NAME.SHOW}`
        );
      }
    }
  }