Made codemirror to fit its content
authorMarcel Werk <burntime@woltlab.com>
Thu, 8 Dec 2016 23:51:27 +0000 (00:51 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 8 Dec 2016 23:51:33 +0000 (00:51 +0100)
wcfsetup/install/files/acp/templates/codemirror.tpl
wcfsetup/install/files/js/3rdParty/codemirror/codemirror.css

index 3f0a394a617d42945111fdde651007465d2307c4..f1aba4f5e26df1e41adc8c8794f41d21d31190b7 100644 (file)
@@ -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) {
index 18b0bf70dbf23089e37f5a1567fc9cb3a0339500..98d2e4a44d4486cdc8cfca28a69c739da03ea23e 100644 (file)
@@ -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;