mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
CodeMirror updates
This commit is contained in:
parent
8564602256
commit
eebf3dae95
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
13
plugins/tiddlywiki/codemirror/styles.tid
Normal file
13
plugins/tiddlywiki/codemirror/styles.tid
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user