From 0918e7e694e82ab6e14ecb2fe9d752d58fea11da Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 22 May 2018 14:42:05 +0100 Subject: [PATCH 1/2] Fix CodeMirror not scrolling correctly CM has a hard-coded 300px height in it's stylesheet. Because of the way we absolutely position the editor (to work with the dividers) we need to work a bit to set the CM height to 100% --- .../web/public/stylesheets/app/editor.less | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/services/web/public/stylesheets/app/editor.less b/services/web/public/stylesheets/app/editor.less index 1fcbde35d6..fc52bfb156 100644 --- a/services/web/public/stylesheets/app/editor.less +++ b/services/web/public/stylesheets/app/editor.less @@ -201,13 +201,9 @@ } } -.cm-editor-wrapper { - height: 100%; - - .CodeMirror { - height: 100%; - } -} +/************************************** +Ace +***************************************/ // The internal components of the aceEditor directive .ace-editor-wrapper { @@ -282,6 +278,23 @@ } } +/************************************** +CodeMirror +***************************************/ +.cm-editor-wrapper { + position: relative; + height: 100%; +} + +.cm-editor-body { + height: 100%; +} + +// CM (for some reason) has height set to 300px in it's stylesheet +.CodeMirror { + height: 100%; +} + .ui-layout-resizer when (@is-overleaf = false) { width: 6px; background-color: @editor-resizer-bg-color; From 5ecb02bd66398b075cef982d517c5e8186cb2e65 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 22 May 2018 17:57:44 +0100 Subject: [PATCH 2/2] Set size of RT when review panel is expanded --- .../web/public/stylesheets/app/editor/review-panel.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/web/public/stylesheets/app/editor/review-panel.less b/services/web/public/stylesheets/app/editor/review-panel.less index 5e846be008..1ed723c3b4 100644 --- a/services/web/public/stylesheets/app/editor/review-panel.less +++ b/services/web/public/stylesheets/app/editor/review-panel.less @@ -775,6 +775,12 @@ } } +#editor-rich-text { + .rp-size-expanded & { + right: @review-panel-width; + } +} + .rp-toggle { display: inline-block; vertical-align: middle;