diff --git a/bi/base.css b/bi/base.css index 369a7c7f3c..e304763622 100644 --- a/bi/base.css +++ b/bi/base.css @@ -424,13 +424,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { margin: 0; white-space: pre; word-wrap: normal; - line-height: inherit; color: inherit; z-index: 2; position: relative; overflow: visible; -webkit-tap-highlight-color: transparent; } +.codemirror-high-line-height { + line-height: 2; +} +.codemirror-low-line-height { + line-height: 1.4; +} .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; diff --git a/bi/base.js b/bi/base.js index a97de0bb82..c64eebd0b8 100644 --- a/bi/base.js +++ b/bi/base.js @@ -14260,7 +14260,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, { watermark: '', value: '', fieldTextValueMap: {}, - showHint: true + showHint: true, + lineHeight: 2 }); }, _init: function () { @@ -14272,6 +14273,7 @@ BI.FormulaEditor = BI.inherit(BI.Single, { lineNumbers: false, mode: 'formula' }); + o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { self._checkWaterMark(); if (o.showHint) { @@ -17712,7 +17714,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), { baseCls: 'bi-code-editor bi-card', value: '', - watermark: "" + watermark: "", + lineHeight: 2 }); }, _init: function () { @@ -17723,6 +17726,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { lineWrapping: true, lineNumbers: false }); + o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { BI.nextTick(function () { self.fireEvent(BI.CodeEditor.EVENT_CHANGE) diff --git a/docs/base.css b/docs/base.css index 369a7c7f3c..e304763622 100644 --- a/docs/base.css +++ b/docs/base.css @@ -424,13 +424,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { margin: 0; white-space: pre; word-wrap: normal; - line-height: inherit; color: inherit; z-index: 2; position: relative; overflow: visible; -webkit-tap-highlight-color: transparent; } +.codemirror-high-line-height { + line-height: 2; +} +.codemirror-low-line-height { + line-height: 1.4; +} .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; diff --git a/docs/base.js b/docs/base.js index a97de0bb82..c64eebd0b8 100644 --- a/docs/base.js +++ b/docs/base.js @@ -14260,7 +14260,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, { watermark: '', value: '', fieldTextValueMap: {}, - showHint: true + showHint: true, + lineHeight: 2 }); }, _init: function () { @@ -14272,6 +14273,7 @@ BI.FormulaEditor = BI.inherit(BI.Single, { lineNumbers: false, mode: 'formula' }); + o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { self._checkWaterMark(); if (o.showHint) { @@ -17712,7 +17714,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), { baseCls: 'bi-code-editor bi-card', value: '', - watermark: "" + watermark: "", + lineHeight: 2 }); }, _init: function () { @@ -17723,6 +17726,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { lineWrapping: true, lineNumbers: false }); + o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { BI.nextTick(function () { self.fireEvent(BI.CodeEditor.EVENT_CHANGE) diff --git a/src/base/formula/formulaeditor.js b/src/base/formula/formulaeditor.js index 9d721e4200..74da714330 100644 --- a/src/base/formula/formulaeditor.js +++ b/src/base/formula/formulaeditor.js @@ -10,7 +10,8 @@ BI.FormulaEditor = BI.inherit(BI.Single, { watermark: '', value: '', fieldTextValueMap: {}, - showHint: true + showHint: true, + lineHeight: 2 }); }, _init: function () { @@ -22,6 +23,7 @@ BI.FormulaEditor = BI.inherit(BI.Single, { lineNumbers: false, mode: 'formula' }); + o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { self._checkWaterMark(); if (o.showHint) { diff --git a/src/base/single/editor/editor.code.js b/src/base/single/editor/editor.code.js index 997d572528..f97564f62a 100644 --- a/src/base/single/editor/editor.code.js +++ b/src/base/single/editor/editor.code.js @@ -9,7 +9,8 @@ BI.CodeEditor = BI.inherit(BI.Single, { return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), { baseCls: 'bi-code-editor bi-card', value: '', - watermark: "" + watermark: "", + lineHeight: 2 }); }, _init: function () { @@ -20,6 +21,7 @@ BI.CodeEditor = BI.inherit(BI.Single, { lineWrapping: true, lineNumbers: false }); + o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); this.editor.on("change", function (cm, change) { BI.nextTick(function () { self.fireEvent(BI.CodeEditor.EVENT_CHANGE) diff --git a/src/css/base/formula/codemirror.css b/src/css/base/formula/codemirror.css index 16c4dff52d..c6d2a97d55 100644 --- a/src/css/base/formula/codemirror.css +++ b/src/css/base/formula/codemirror.css @@ -331,13 +331,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { margin: 0; white-space: pre; word-wrap: normal; - line-height: inherit; color: inherit; z-index: 2; position: relative; overflow: visible; -webkit-tap-highlight-color: transparent; } +.codemirror-high-line-height { + line-height: 2; +} +.codemirror-low-line-height { + line-height: 1.4; +} .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; diff --git a/src/less/base/formula/codemirror.less b/src/less/base/formula/codemirror.less index 551883a9a3..a7d8476f6e 100644 --- a/src/less/base/formula/codemirror.less +++ b/src/less/base/formula/codemirror.less @@ -409,7 +409,6 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { margin: 0; white-space: pre; word-wrap: normal; - line-height: inherit; color: inherit; z-index: 2; position: relative; @@ -417,6 +416,15 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket { -webkit-tap-highlight-color: transparent; } +.codemirror-high-line-height { + line-height: 2; +} + +.codemirror-low-line-height { + line-height: 1.4; +} + + .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap;