Sha256: 15013cf71e9f574bdd6dc957d51361d6aafb2ac0d1bbead173b28f9369c2099c

Contents?: true

Size: 790 Bytes

Versions: 16

Compression:

Stored size: 790 Bytes

Contents

import React from "react";
import ReactDOM from "react-dom";
import RichTextArea from "../components/RichTextArea";
import readyHandler from "../lib/readyHandler";

class RichText {
  apply () {
    const elems = document.querySelectorAll("textarea.rich");
    elems.forEach((elem) => {
      this.enhance(elem);
    });
  }

  enhance (elem) {
    const container = document.createElement("div");
    elem.parentNode.appendChild(container);
    ReactDOM.render(
      <RichTextArea value={elem.value}
                    name={elem.name}
                    rows={elem.rows}
                    id={elem.id} />,
      container
    );
    elem.parentNode.removeChild(elem);
  }

  start () {
    readyHandler.ready(() => {
      this.apply();
    });
  }
}

export default new RichText();

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pages_core-3.12.2 app/javascript/features/RichText.jsx
pages_core-3.12.1 app/javascript/features/RichText.jsx
pages_core-3.12.0 app/javascript/features/RichText.jsx
pages_core-3.11.3 app/javascript/features/RichText.jsx
pages_core-3.11.2 app/javascript/features/RichText.jsx
pages_core-3.11.1 app/javascript/features/RichText.jsx
pages_core-3.11.0 app/javascript/features/RichText.jsx
pages_core-3.10.2 app/javascript/features/RichText.jsx
pages_core-3.10.1 app/javascript/features/RichText.jsx
pages_core-3.9.2 app/javascript/features/RichText.jsx
pages_core-3.9.1 app/javascript/features/RichText.jsx
pages_core-3.9.0 app/javascript/features/RichText.jsx
pages_core-3.8.3 app/javascript/features/RichText.jsx
pages_core-3.8.2 app/javascript/features/RichText.jsx
pages_core-3.8.1 app/javascript/features/RichText.jsx
pages_core-3.8.0 app/javascript/features/RichText.jsx