CodeMirror updates

print-window-tiddler
Jeremy Ruston 2013-05-15 17:32:28 +01:00
rodzic 8564602256
commit eebf3dae95
2 zmienionych plików z 22 dodań i 5 usunięć

Wyświetl plik

@ -83,15 +83,19 @@ CodeMirrorEditor.prototype.render = function() {
this.editWidget.attributes = {
"class": "tw-edit-CodeMirrorEditor"
};
this.editWidget.children = this.editWidget.renderer.renderTree.createRenderers(this.editWidget.renderer.renderContext,[node]);
this.editWidget.children = this.editWidget.renderer.renderTree.createRenderers(this.editWidget.renderer,[node]);
};
CodeMirrorEditor.prototype.postRenderInDom = function() {
if(this.type === "textarea") {
CodeMirror.fromTextArea(this.editWidget.children[0].domNode,{
lineWrapping: true,
lineNumbers: true
});
var self = this;
// HACK: We use the timeout because postRenderInDom is called before the dom nodes have been added to the document
window.setTimeout(function() {
self.codemirrorInstance = CodeMirror.fromTextArea(self.editWidget.children[0].domNode,{
lineWrapping: true,
lineNumbers: true
});
},1);
}
};

Wyświetl plik

@ -0,0 +1,13 @@
title: $:/plugins/tiddlywiki/codemirror/styles
tags: [[$:/tags/stylesheet]]
/* Make the editor resize to fit its content */
.CodeMirror {
height: auto;
}
.CodeMirror-scroll {
overflow-x: auto;
overflow-y: hidden;
}