2 'libs/text!./template.html',
3 'libs/jquery-1.9.1.min',
5 'modules/nodePane/metaWidget/metaWidget'
6 ], function(templateSrc, $, _, metaWidget) {
10 return function(sandbox) {
12 var view = $(_.template(templateSrc)());
14 view.on('change', 'select', function(e) {
15 var target = $(e.target);
16 var attr = target.attr('class').split('-')[3] === 'tagSelect' ? 'tag' : 'class';
17 sandbox.publish('nodeElementChange', attr, target.val().replace(/-/g, '.'));
22 sandbox.publish('ready');
27 setNodeElement: function(nodeElement) {
28 view.find('.rng-module-nodePane-tagSelect').val(nodeElement.getWlxmlTag());
30 var escapedClassName = (nodeElement.getWlxmlClass() || '').replace(/\./g, '-')
31 view.find('.rng-module-nodePane-classSelect').val(escapedClassName);
33 var widget = metaWidget.create({attrs:nodeElement.getWlxmlMetaAttrs()});
34 widget.on('valueChanged', function(key, value) {
35 sandbox.publish('nodeElementChange', key, value);
37 view.find('.metaFields').empty().append(widget.el);