From e198f35a290e966cf8b6514aac2b02e70865dd68 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Mon, 9 Dec 2019 09:40:57 +0100 Subject: [PATCH] comments: fixed codemirror styling problems. --- rhodecode/public/css/codemirror.less | 5 +++-- .../public/js/src/rhodecode/codemirror.js | 19 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rhodecode/public/css/codemirror.less b/rhodecode/public/css/codemirror.less index 62d1e813..90bdf1b4 100644 --- a/rhodecode/public/css/codemirror.less +++ b/rhodecode/public/css/codemirror.less @@ -298,8 +298,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} .CodeMirror-gutter, .CodeMirror-gutters, .CodeMirror-linenumber { - -moz-box-sizing: content-box; - box-sizing: content-box; + /* RhodeCode added !important, to fix diffs rule */ + -moz-box-sizing: content-box !important; + box-sizing: content-box !important; } .CodeMirror-measure { diff --git a/rhodecode/public/js/src/rhodecode/codemirror.js b/rhodecode/public/js/src/rhodecode/codemirror.js index 372d620e..73d762ae 100644 --- a/rhodecode/public/js/src/rhodecode/codemirror.js +++ b/rhodecode/public/js/src/rhodecode/codemirror.js @@ -269,14 +269,13 @@ var initMarkupCodeMirror = function(textAreadId, focus, options) { cmLog.debug('Loading codemirror mode', DEFAULT_RENDERER); // start listening on changes to make auto-expanded editor - cm.on("change", function(instance, changeObj) { + cm.on("change", function (instance, changeObj) { var height = initialHeight; var lines = instance.lineCount(); - if ( lines > 6 && lines < 20) { + if (lines > 6 && lines < 20) { height = "auto"; - } - else if (lines >= 20){ - zheight = 20*15; + } else if (lines >= 20) { + height = 20 * 15; } instance.setSize(null, height); @@ -501,15 +500,15 @@ var initCommentBoxCodeMirror = function(CommentForm, textAreaId, triggerActions) cm.setOption("mode", DEFAULT_RENDERER); CodeMirror.autoLoadMode(cm, DEFAULT_RENDERER); // load rst or markdown mode cmLog.debug('Loading codemirror mode', DEFAULT_RENDERER); + // start listening on changes to make auto-expanded editor - cm.on("change", function(self) { + cm.on("change", function (self) { var height = initialHeight; var lines = self.lineCount(); - if ( lines > 6 && lines < 20) { + if (lines > 6 && lines < 20) { height = "auto"; - } - else if (lines >= 20){ - zheight = 20*15; + } else if (lines >= 20) { + height = 20 * 15; } self.setSize(null, height); });