From 657c99189a9e8d9cf154129b37155fdb0a2dbc03 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 9 Dec 2016 00:51:27 +0100 Subject: [PATCH] Made codemirror to fit its content --- wcfsetup/install/files/acp/templates/codemirror.tpl | 3 ++- wcfsetup/install/files/js/3rdParty/codemirror/codemirror.css | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/codemirror.tpl b/wcfsetup/install/files/acp/templates/codemirror.tpl index 3f0a394a61..f1aba4f5e2 100644 --- a/wcfsetup/install/files/acp/templates/codemirror.tpl +++ b/wcfsetup/install/files/acp/templates/codemirror.tpl @@ -43,7 +43,8 @@ indentWithTabs: true, lineNumbers: true, indentUnit: 4, - readOnly: {if !$editable|isset || $editable}false{else}true{/if} + readOnly: {if !$editable|isset || $editable}false{else}true{/if}, + viewportMargin: Infinity }; [].forEach.call(elements, function (element) { diff --git a/wcfsetup/install/files/js/3rdParty/codemirror/codemirror.css b/wcfsetup/install/files/js/3rdParty/codemirror/codemirror.css index 18b0bf70db..98d2e4a44d 100644 --- a/wcfsetup/install/files/js/3rdParty/codemirror/codemirror.css +++ b/wcfsetup/install/files/js/3rdParty/codemirror/codemirror.css @@ -3,7 +3,7 @@ .CodeMirror { /* Set height, width, borders, and global font properties here */ font-family: monospace; - height: 300px; + height: auto; color: black; } @@ -164,6 +164,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} height: 100%; outline: none; /* Prevent dragging from highlighting the element */ position: relative; + min-height: 300px; + max-height: 1000px; } .CodeMirror-sizer { position: relative; -- 2.20.1