From: Aleksander Ɓukasz Date: Wed, 25 Jun 2014 07:59:05 +0000 (+0200) Subject: editor: canvas fix - check for the case when mutation concerns already detached text... X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/dea68129ff763bf38f632ad7373072faf1fda1ba?hp=e3d081dda1fe6502f0809ddf602d2c0bdf1f24ae editor: canvas fix - check for the case when mutation concerns already detached text node --- 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;