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

Unified Diff: experimental/webtry/res/js/webtry.js

Issue 626033004: Automatically resize the webtry text editor to fit the content (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « experimental/webtry/res/css/cm/codemirror.css ('k') | experimental/webtry/templates/content.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/res/js/webtry.js
diff --git a/experimental/webtry/res/js/webtry.js b/experimental/webtry/res/js/webtry.js
index b673e09239e186fe08151dde647567a1e2e393f5..30dac5b90afbb0d15e184625f3f5ca0b3b3b3137 100644
--- a/experimental/webtry/res/js/webtry.js
+++ b/experimental/webtry/res/js/webtry.js
@@ -144,13 +144,15 @@
theme: "default",
lineNumbers: true,
matchBrackets: true,
+ lineWrapping: true,
mode: "text/x-c++src",
indentUnit: 4,
});
- // Match the initial textarea size.
+ // Match the initial textarea width, but leave the height alone
+ // The css will automatically resize the editor vertically.
editor.setSize(editor.defaultCharWidth() * code.cols,
- editor.defaultTextHeight() * code.rows);
+ null);
/**
« no previous file with comments | « experimental/webtry/res/css/cm/codemirror.css ('k') | experimental/webtry/templates/content.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698