Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

477 B
Raw Blame
import { Inject, Injectable, DOCUMENT } from '@angular/core';

@Injectable()
export class BcfDetectorService {
  constructor(@Inject(DOCUMENT) private documentElement:Document) {
  }

  /**
   * Detect whether the BCF module was activated,
   * resulting in a body class.
   */
  public get isBcfActivated() {
    return this.hasBodyClass('bcf-activated');
  }

  private hasBodyClass(name:string):boolean {
    return this.documentElement.body.classList.contains(name);
  }
}