1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-05 19:53:17 +00:00

Fixed problem with firing our own DOM mutation events

This commit is contained in:
Jeremy Ruston 2012-03-30 19:51:11 +01:00
parent 9b145638ec
commit 2faa668717

View File

@ -94,6 +94,10 @@ exports.macro = {
if(this.dependencies.hasChanged(changes,this.tiddlerTitle)) {
// Don't refresh the editor if it contains the caret or selection
if(!window.getSelection().containsNode(this.domNode, true)) {
// Remove the event handlers so they don't get triggered by the following DOM manipulations
for(var e in exports.macro.events) {
this.domNode.removeEventListener(e,this,false);
}
// Remove the previous content
while(this.domNode.hasChildNodes()) {
this.domNode.removeChild(this.domNode.firstChild);