attach()

in js/rough-notation.js [494:525]


    attach() {
      if ("unattached" === this._state && this._e.parentElement) {
        !(function () {
          if (!window.__rno_kf_s) {
            const t = (window.__rno_kf_s = document.createElement("style"));
            (t.textContent =
              "@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }"),
              document.head.appendChild(t);
          }
        })();
        const t = (this._svg = document.createElementNS(e, "svg"));
        t.setAttribute("class", "rough-annotation");
        const s = t.style;
        (s.position = "absolute"),
          (s.top = "0"),
          (s.left = "0"),
          (s.overflow = "visible"),
          (s.pointerEvents = "none"),
          (s.width = "100px"),
          (s.height = "100px");
        const i = "highlight" === this._config.type;
        if (
          (this._e.insertAdjacentElement(i ? "beforebegin" : "afterend", t),
          (this._state = "not-showing"),
          i)
        ) {
          const t = window.getComputedStyle(this._e).position;
          (!t || "static" === t) && (this._e.style.position = "relative");
        }
        this.attachListeners();
      }
    }