mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-05 21:33:52 +00:00
CodeMirror updates
This commit is contained in:
parent
8564602256
commit
eebf3dae95
@ -83,15 +83,19 @@ CodeMirrorEditor.prototype.render = function() {
|
|||||||
this.editWidget.attributes = {
|
this.editWidget.attributes = {
|
||||||
"class": "tw-edit-CodeMirrorEditor"
|
"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() {
|
CodeMirrorEditor.prototype.postRenderInDom = function() {
|
||||||
if(this.type === "textarea") {
|
if(this.type === "textarea") {
|
||||||
CodeMirror.fromTextArea(this.editWidget.children[0].domNode,{
|
var self = this;
|
||||||
lineWrapping: true,
|
// HACK: We use the timeout because postRenderInDom is called before the dom nodes have been added to the document
|
||||||
lineNumbers: true
|
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…
x
Reference in New Issue
Block a user