1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-15 23:07:18 +00:00

Refactored editor logic to handle refreshes more efficiently

This commit is contained in:
Jeremy Ruston
2012-07-11 15:52:15 +01:00
parent 6a0a4ae00d
commit d16481c524
3 changed files with 22 additions and 23 deletions

View File

@@ -50,16 +50,8 @@ exports.refreshInDom = function(changes) {
var t;
// Only refresh if a dependency is triggered
if(this.dependencies.hasChanged(changes,this.tiddlerTitle)) {
// Only refresh if the editor lets us
if(this.editor.isRefreshable()) {
// Remove the previous child
var parent = this.child.domNode.parentNode,
nextSibling = this.child.domNode.nextSibling;
parent.removeChild(this.child.domNode);
// Execute the macro
this.execute(this.parents,this.tiddlerTitle);
// Render to the DOM
this.child.renderInDom(parent,nextSibling);
if(this.editor.refreshInDom) {
this.editor.refreshInDom();
}
} else {
// Refresh any children