diff --git a/src/forge/Newfile/index.css b/src/forge/Newfile/index.css index 746febe55..0bda4711a 100644 --- a/src/forge/Newfile/index.css +++ b/src/forge/Newfile/index.css @@ -1,3 +1,11 @@ +.editorBorderBox .CodeMirror +{ + height: unset; +} +.editorBorderBox .CodeMirror .CodeMirror-scroll{ + min-height: 300px; +} + .setInputAddon{ width: 350px; margin-right: 20px; @@ -9,12 +17,16 @@ border-right: none!important; } .editorBorder .editorBorderBox{ - border:1px solid #eee; + border:1px solid #d0d0d0; border-radius: 2px; + border-bottom: none; } .editorBorder .editorBorderSubmitBox{ padding:20px 0px!important; } +.editorBorderSubmitBox{ + border-top: 1px solid #d0d0d0; +} .userScrew{ margin:20px 0px; border:1px solid #f4f4f4; diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index 13d2ec466..8e90d51f2 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -1,6 +1,10 @@ import React, { Component } from "react"; import Editor from "react-monaco-editor"; -// import {UnControlled as CodeMirror} from 'react-codemirror2' +import {UnControlled as CodeMirror} from 'react-codemirror2'; +import 'codemirror/addon/selection/active-line.js'; +import 'codemirror/mode/javascript/javascript.js'; +import 'codemirror/mode/clike/clike'; +import 'codemirror/mode/css/css'; import UserSubmitComponent from "./UserSubmitComponent"; @@ -12,6 +16,7 @@ class m_editor extends Component { super(props); this.state = { editorValue: this.props.content, + changeValue:this.props.content, prevHeight:0 }; } @@ -22,14 +27,14 @@ class m_editor extends Component { }) } } - changeEditor = (editorValue) => { + changeEditor = (editorValue,data) => { this.setState({ - editorValue, + changeValue:editorValue.getValue(), }); }; render() { - const { editorValue } = this.state; + const { editorValue , changeValue } = this.state; const { readOnly, editorType, language , currentBranch , descName } = this.props; const editor_options = { lineNumbers: "on", @@ -91,11 +96,10 @@ class m_editor extends Component { updateEditorHeight(); // typing }; - return (
- - {/* */} +
{!readOnly && ( -
+