X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b7d40f4f02e71505150c8b33ad3ad7d7acde0ae2..2936591f2732b8c8f23c4edffc0f1a7b30d4bcf0:/modules/documentCanvas/documentCanvas.js?ds=inline 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) {