Fix CodeMirror on fake dom (#3547)

* fix for #3547

see https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty

because of "strict mode" - the `parentNode` property may not be writable and causes an error in `fakedom.js` (appendChild)

to reproduce: install CodeMirror, install "Tools for exploring internals of TW", open a heavy Tiddler like the Control-Panel in edit-mode, toggle preview on, switch to "parse tree" or "widget tree"

* check for tw fakedom
logging-improvements
BurningTreeC 2018-11-19 21:56:59 +01:00 zatwierdzone przez Jeremy Ruston
rodzic eea034c32d
commit b629b1412d
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -109,7 +109,9 @@ function CodeMirrorEngine(options) {
// Create the CodeMirror instance
this.cm = window.CodeMirror(function(cmDomNode) {
// Note that this is a synchronous callback that is called before the constructor returns
self.domNode.appendChild(cmDomNode);
if(!self.widget.document.isTiddlyWikiFakeDom) {
self.domNode.appendChild(cmDomNode);
}
},config);
// Set up a change event handler