X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0214643f72c6aaa8e85eaba2ad27f2ca03ca6401..8bf6c2bb6ef0a358a3591d19d6aff7a1f7f22b92:/modules/nodePane/nodePane.js diff --git a/modules/nodePane/nodePane.js b/modules/nodePane/nodePane.js index 47777b7..b825b1b 100644 --- a/modules/nodePane/nodePane.js +++ b/modules/nodePane/nodePane.js @@ -5,13 +5,15 @@ define([ ], function(templateSrc, $, _) { +'use strict'; + return function(sandbox) { - view = $(_.template(templateSrc)()); + var view = $(_.template(templateSrc)()); view.on('change', 'select', function(e) { var target = $(e.target); - var attr = target.attr('class').split('-')[2].split('nodePane')[1].substr(0,3) === 'Tag' ? 'tag' : 'class'; + var attr = target.attr('class').split('-')[3] === 'tagSelect' ? 'tag' : 'class'; sandbox.publish('nodeChanged', attr, target.val()); }); @@ -22,11 +24,9 @@ return function(sandbox) { getView: function() { return view; }, - setNode: function(node) { - var tag = node.attr('wlxml-tag'); - var klass = node.attr('wlxml-class'); - view.find('.rng-module-nodePane-tagSelect').val(tag); - view.find('.rng-module-nodePane-classSelect').val(klass); + setNode: function(canvasNode) { + view.find('.rng-module-nodePane-tagSelect').val(canvasNode.getTag()); + view.find('.rng-module-nodePane-classSelect').val(canvasNode.getClass()); } }