From: Marcel Werk Date: Thu, 8 Dec 2016 23:51:27 +0000 (+0100) Subject: Made codemirror to fit its content X-Git-Tag: 3.0.0_RC_1~67 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=657c99189a9e8d9cf154129b37155fdb0a2dbc03;p=GitHub%2FWoltLab%2FWCF.git Made codemirror to fit its content --- 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;