From 2faa6687179080cd07fbcaaa1ae57886ba7befbc Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 30 Mar 2012 19:51:11 +0100 Subject: [PATCH] Fixed problem with firing our own DOM mutation events --- js/macros/edit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/macros/edit.js b/js/macros/edit.js index 0c624d9d1..53001e6db 100644 --- a/js/macros/edit.js +++ b/js/macros/edit.js @@ -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);