X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b7d40f4f02e71505150c8b33ad3ad7d7acde0ae2..6c473f4c60fdc93c908b537ff71a5d77bc2ad98b:/modules/documentCanvas/documentCanvas.js diff --git a/modules/documentCanvas/documentCanvas.js b/modules/documentCanvas/documentCanvas.js index df11ea0..9d2e725 100644 --- a/modules/documentCanvas/documentCanvas.js +++ b/modules/documentCanvas/documentCanvas.js @@ -6,7 +6,7 @@ define([ './wlxmlNode', 'libs/text!./template.html'], function(_, transformations, wlxmlNode, template) { - +'use strict'; return function(sandbox) { @@ -57,7 +57,7 @@ return function(sandbox) { _.each(mutation.addedNodes, function(node) { node = $(node); node.parent().find('[wlxml-tag]').each(function() { - tag = $(this); + var tag = $(this); if(!tag.attr('id')) 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);})); }); @@ -239,8 +239,8 @@ return function(sandbox) { }, modifyCurrentNode: function(attr, value) { if(view.currentNode) { - view.currentNode.attr('wlxml-'+attr, value); - sandbox.publish('contentEdited'); + view.getNodeElement(view.currentNode).attr('wlxml-'+attr, value); + sandbox.publish('contentChanged'); } }, highlightNode: function(wlxmlNode) {