From: Aleksander Ɓukasz Date: Thu, 8 Aug 2013 07:42:40 +0000 (+0200) Subject: Fix: Missing contentChange event on typing X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/2995b6af11c75c66e6a3a398486bd01c70bfd016?ds=inline;hp=a668392f4bf349515340b8691c059267f2b51996 Fix: Missing contentChange event on typing --- diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index 9282d20..0041f6c 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -313,8 +313,11 @@ $.extend(Canvas.prototype, { var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { - if(documentElement.DocumentTextElement.isContentContainer(mutation.target) && mutation.target.data === '') - mutation.target.data = utils.unicode.ZWS; + if(documentElement.DocumentTextElement.isContentContainer(mutation.target)) { + if(mutation.target.data === '') + mutation.target.data = utils.unicode.ZWS; + canvas.publisher('contentChanged'); + } }); }); var config = { attributes: false, childList: false, characterData: true, subtree: true, characterDataOldValue: true};