From dea68129ff763bf38f632ad7373072faf1fda1ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 25 Jun 2014 09:59:05 +0200 Subject: [PATCH] editor: canvas fix - check for the case when mutation concerns already detached text node --- src/editor/modules/documentCanvas/canvas/canvas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index d4e16ad..50c0ae4 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -200,7 +200,7 @@ $.extend(Canvas.prototype, Backbone.Events, { /* globals MutationObserver */ var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { - if(documentElement.DocumentTextElement.isContentContainer(mutation.target)) { + if(canvas.dom[0].contains(mutation.target) && documentElement.DocumentTextElement.isContentContainer(mutation.target)) { observer.disconnect(); if(mutation.target.data === '') { mutation.target.data = utils.unicode.ZWS; -- 2.20.1