X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/ce24094b892d3fb0faf000b5e2bf64f58ce4aae5..e7de024e8c0798383a31b7c8bb08dc31a5ce876a:/modules/nodePane/nodePane.js diff --git a/modules/nodePane/nodePane.js b/modules/nodePane/nodePane.js index a1c2a81..3a4a0ef 100644 --- a/modules/nodePane/nodePane.js +++ b/modules/nodePane/nodePane.js @@ -14,7 +14,7 @@ return function(sandbox) { view.on('change', 'select', function(e) { var target = $(e.target); var attr = target.attr('class').split('-')[3] === 'tagSelect' ? 'tag' : 'class'; - sandbox.publish('nodeElementChange', attr, target.val()); + sandbox.publish('nodeElementChange', attr, target.val().replace(/-/g, '.')); }); return { @@ -26,13 +26,15 @@ return function(sandbox) { }, setNodeElement: function(nodeElement) { view.find('.rng-module-nodePane-tagSelect').val(nodeElement.getWlxmlTag()); - view.find('.rng-module-nodePane-classSelect').val(nodeElement.getWlxmlClass()); - //var widget = metaWidget.create({attrs:canvasNode.getMetaAttrs()}); - //widget.on('valueChanged', function(key, value) { - // sandbox.publish('nodeChanged', key, value); - //}); - //view.find('.metaFields').empty().append(widget.el); + var escapedClassName = (nodeElement.getWlxmlClass() || '').replace(/\./g, '-') + view.find('.rng-module-nodePane-classSelect').val(escapedClassName); + + var widget = metaWidget.create({attrs:nodeElement.getWlxmlMetaAttrs()}); + widget.on('valueChanged', function(key, value) { + sandbox.publish('nodeElementChange', key, value); + }); + view.find('.metaFields').empty().append(widget.el); } };