diff options
| author | terminaldweller <thabogre@gmail.com> | 2022-05-19 01:19:19 +0000 | 
|---|---|---|
| committer | terminaldweller <thabogre@gmail.com> | 2022-05-19 01:19:19 +0000 | 
| commit | 2b65ee76460fb41969dcf8643d5719439346ae26 (patch) | |
| tree | 856a62cc24a50077d8f6c7bbdde677f7539f1913 /spring-front/src/components | |
| parent | CRUD tested and working (diff) | |
| download | mdrtl-2b65ee76460fb41969dcf8643d5719439346ae26.tar.gz mdrtl-2b65ee76460fb41969dcf8643d5719439346ae26.zip | |
added icons for save,load,delete
Diffstat (limited to 'spring-front/src/components')
| -rw-r--r-- | spring-front/src/components/Editor.js | 16 | 
1 files changed, 13 insertions, 3 deletions
| diff --git a/spring-front/src/components/Editor.js b/spring-front/src/components/Editor.js index 3f8fefb..eee31a9 100644 --- a/spring-front/src/components/Editor.js +++ b/spring-front/src/components/Editor.js @@ -26,7 +26,7 @@ const md = new mit({ html: true })    .use(mittexmath, {      engine: katex,      delimiters: "gitlab", -    katexOptions: { macros: { "\\RR": "\\mathbb{R}" }, output: "mathml" }, +    katexOptions: { output: "mathml" },    })    .use(mitmmdtable)    .use(mithljs, { inline: true, auto: true, code: true, hljs: hljs }); @@ -41,7 +41,8 @@ export default class Editor extends React.Component {        this.updateCodeSyntaxHighlighting.bind(this);      this.handleChange = this.handleChange.bind(this);      this.parseMarkdown = this.parseMarkdown.bind(this); -    this.state = { value: "" }; +    this.handleTitleClick = this.handleTitleClick.bind(this); +    this.state = { value: "", drawerActive: false };      // this.hljs_worker = new Worker("../highlight_worker.js");      // this.md_worker = new Worker("../parse_worker.js");    } @@ -112,7 +113,13 @@ export default class Editor extends React.Component {      }    } +  handleTitleClick() { +    this.setState((prevState) => ({ drawerActive: !prevState.drawerActive })); +  } +    render() { +    const { markdownText, drawerTitle, drawerChildren } = this.props; +    const drawerStyles = this.state.drawerActive ? "is-expanded" : "";      return (        <div>          <div> @@ -134,7 +141,10 @@ export default class Editor extends React.Component {              onScroll={this.handleScroll.bind(this)}              onKeyDown={this.handleKeyDown.bind(this)}              direction="rtl" -          ></textarea> +            tabIndex="0" +          > +            {markdownText} +          </textarea>          </div>          <div className="split right">            <div direction="rtl" id="markdown-placeholder"></div> | 
