Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js

Issue 2331053002: DevTools: Implement the console prompt with CodeMirror (Closed)
Patch Set: Merge Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
index 4f27a0a3805a1d69bb03aaf5dbc67c65481c5507..ad20610c0064b8d5666d888fb959aa45e29ec7d5 100644
--- a/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js
@@ -162,6 +162,8 @@ WebInspector.CodeMirrorTextEditor = function(options)
this.element.tabIndex = 0;
if (options.mimeType)
this.setMimeType(options.mimeType);
+ if (options.autoHeight)
+ this._codeMirror.setSize(null, "auto");
}
WebInspector.CodeMirrorTextEditor.maxHighlightLength = 1000;
@@ -979,8 +981,12 @@ WebInspector.CodeMirrorTextEditor.prototype = {
var scrollTop = this._codeMirror.doc.scrollTop;
var width = parentElement.offsetWidth;
var height = parentElement.offsetHeight - this.element.offsetTop;
- this._codeMirror.setSize(width, height);
- this._updatePaddingBottom(width, height);
+ if (this._options.autoHeight) {
+ this._codeMirror.setSize(width, "auto");
+ } else {
+ this._codeMirror.setSize(width, height);
+ this._updatePaddingBottom(width, height);
+ }
this._codeMirror.scrollTo(scrollLeft, scrollTop);
},

Powered by Google App Engine
This is Rietveld 408576698