Working on codemirror display issue in html coursewares

This commit is contained in:
Nathan Leniz
2015-03-21 16:34:06 +09:00
parent a2e2e6bfa2
commit 6ad7c22313
4 changed files with 32 additions and 33 deletions

View File

@@ -3,12 +3,11 @@
*/
var widgets = [];
var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("codeEditor"), {
var editor = CodeMirror.fromTextArea(document.getElementById("codeEditor"), {
lineNumbers: true,
mode: "text/html",
theme: 'monokai',
runnable: true,
//lint: true,
matchBrackets: true,
autoCloseBrackets: true,
scrollbarStyle: 'null',
@@ -16,7 +15,6 @@ var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("codeEditor")
gutters: ["CodeMirror-lint-markers"],
onKeyEvent: doLinting
});
var editor = myCodeMirror;
// Hijack tab key to insert two spaces instead
@@ -117,7 +115,7 @@ var allSeeds = '';
});
})();
myCodeMirror.setValue(allSeeds);
editor.setValue('test');
function doLinting () {
editor.operation(function () {