Showing success message after saving
[fnpeditor.git] / modules / documentCanvas / documentCanvas.js
index df11ea0..9d2e725 100644 (file)
@@ -6,7 +6,7 @@ define([
 './wlxmlNode',\r
 'libs/text!./template.html'], function(_, transformations, wlxmlNode, template) {\r
 \r
-\r
+'use strict';\r
 \r
 return function(sandbox) {\r
 \r
@@ -57,7 +57,7 @@ return function(sandbox) {
                 _.each(mutation.addedNodes, function(node) {\r
                     node = $(node);\r
                     node.parent().find('[wlxml-tag]').each(function() {\r
-                        tag = $(this);\r
+                        var tag = $(this);\r
                         if(!tag.attr('id'))\r
                             tag.attr('id', 'xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}));\r
                     });\r
@@ -239,8 +239,8 @@ return function(sandbox) {
         },\r
         modifyCurrentNode: function(attr, value) {\r
             if(view.currentNode) {\r
-                view.currentNode.attr('wlxml-'+attr, value);\r
-                sandbox.publish('contentEdited');\r
+                view.getNodeElement(view.currentNode).attr('wlxml-'+attr, value);\r
+                sandbox.publish('contentChanged');\r
             }\r
         },\r
         highlightNode: function(wlxmlNode) {\r