From 4a5d4ea288a68784e092b20d27aa1428ebb6715a Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 8 Oct 2021 18:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=96=87=E4=BB=B6border?= =?UTF-8?q?=E5=92=8C=E7=BC=96=E8=BE=91=E5=99=A8=E7=9A=84=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Newfile/Index.js | 22 +++++++------ src/forge/Newfile/index.css | 8 ++++- src/forge/Newfile/m_editor.js | 60 +++++++++++++++++------------------ 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/forge/Newfile/Index.js b/src/forge/Newfile/Index.js index 9b7769552..953f50720 100644 --- a/src/forge/Newfile/Index.js +++ b/src/forge/Newfile/Index.js @@ -65,16 +65,18 @@ class Index extends Component { - +
+ +
diff --git a/src/forge/Newfile/index.css b/src/forge/Newfile/index.css index feb82b97a..746febe55 100644 --- a/src/forge/Newfile/index.css +++ b/src/forge/Newfile/index.css @@ -8,7 +8,13 @@ border: 1px solid #d9d9d9!important; border-right: none!important; } - +.editorBorder .editorBorderBox{ + border:1px solid #eee; + border-radius: 2px; +} +.editorBorder .editorBorderSubmitBox{ + padding:20px 0px!important; +} .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 967717c9b..242f7e0d3 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -69,10 +69,12 @@ class m_editor extends Component { ); const lineCount = editor.getModel().getLineCount() || 1; - const height = + let height = editor.getTopForLineNumber(lineCount + 1) + lineHeight + - padding; + padding ; + + if(height<400){height = 400;} if (this.state.prevHeight !== height) { this.setState({ @@ -89,36 +91,32 @@ class m_editor extends Component { return ( - - -
-
- -
- {!readOnly && ( -
- -
- )} -
+
+ +
+ {!readOnly && ( +
+ +
+ )}
); }