Home Reference Source Repository

src/es6/mode/base.es6

import {d3} from "nbpresent-deps";

export class Mode {
  constructor(root){
    this.root = root;
    this.initStylesheet();
    this.init();
  }

  initStylesheet(){
    let css = d3.select("head")
      .selectAll("link#nbpresent-css")
      .data([1]);

    if(css.node()){
      console.warn("nbpresent extension already loaded!");
      return;
    }

    css.enter()
      .append("link")
      .attr({id: "nbpresent-css"})
      .attr({
        rel: "stylesheet",
        href: `${this.root}/nbpresent.min.css`
      });
  }
}