diff --git a/assets/plugins/codemirror/codemirror.plugin.php b/assets/plugins/codemirror/codemirror.plugin.php index a8d7ad7b87..4228278615 100755 --- a/assets/plugins/codemirror/codemirror.plugin.php +++ b/assets/plugins/codemirror/codemirror.plugin.php @@ -370,6 +370,15 @@ function makeMarker(symbol) { myCodeMirrors['{$el}'] = CodeMirror.fromTextArea(myTextArea, config); if (window.evoElementNameHelper) { window.evoElementNameHelper.installCodeMirror(myCodeMirrors['{$el}']); + } + // .CodeMirror is resize: vertical (custom.css), so the wrapper + // can be dragged taller. CodeMirror renders the lines its last + // measurement said would fit, so the new space stays blank + // until it is asked to measure again. + if (window.ResizeObserver) { + new ResizeObserver(function() { + myCodeMirrors['{$el}'].refresh(); + }).observe(myCodeMirrors['{$el}'].getWrapperElement()); } {$setHeight} // reset onchange tab diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index f0552fbdc9..70e2e82b8a 100644 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -471,6 +471,12 @@ div.mce-fullscreen { margin-top:2.6rem; } .mceEditor .mceToolbar td { height: 24px; float: left } /* codeMirror */ .CodeMirror { width: 100%; margin: 0 !important; } +/* Drag the bottom edge to make any editor taller. The wrapper is already + overflow: hidden (codemirror.css), which is what lets resize apply to it. + CodeMirror only draws the lines its last measurement said would fit, so + the instance has to refresh on resize or the new space stays blank - the + CodeMirror plugin does that for the editors it creates. */ +.CodeMirror { resize: vertical; } .CodeMirror pre { word-break: break-all !important; } .CodeMirror > div:first-child > textarea { /*opacity: 0;*/ z-index: -1; left: -9999rem; }