Fix: Missing contentChange event on typing
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 8 Aug 2013 07:42:40 +0000 (09:42 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 8 Aug 2013 07:42:40 +0000 (09:42 +0200)
modules/documentCanvas/canvas/canvas.js

index 9282d20..0041f6c 100644 (file)
@@ -313,8 +313,11 @@ $.extend(Canvas.prototype, {
 
             var observer = new MutationObserver(function(mutations) {
                 mutations.forEach(function(mutation) {
 
             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};
                 });
             });
             var config = { attributes: false, childList: false, characterData: true, subtree: true, characterDataOldValue: true};