2 'libs/text!./template.html',
3 'libs/jquery-1.9.1.min',
5 'modules/nodePane/metaWidget/metaWidget',
7 ], function(templateSrc, $, _, metaWidget, wlxmlUtils) {
11 return function(sandbox) {
13 var view = $(_.template(templateSrc)({tagNames: wlxmlUtils.wlxmlTagNames, classNames: wlxmlUtils.wlxmlClassNames}));
15 view.on('change', 'select', function(e) {
16 var target = $(e.target);
17 var attr = target.attr('class').split('-')[3] === 'tagSelect' ? 'tag' : 'class';
18 sandbox.publish('nodeElementChange', attr, target.val().replace(/-/g, '.'));
23 sandbox.publish('ready');
28 setNodeElement: function(nodeElement) {
29 view.find('.rng-module-nodePane-tagSelect').val(nodeElement.getWlxmlTag());
31 var escapedClassName = (nodeElement.getWlxmlClass() || '').replace(/\./g, '-')
32 view.find('.rng-module-nodePane-classSelect').val(escapedClassName);
34 var widget = metaWidget.create({attrs:nodeElement.getWlxmlMetaAttrs()});
35 widget.on('valueChanged', function(key, value) {
36 sandbox.publish('nodeElementChange', key, value);
38 view.find('.metaFields').empty().append(widget.el);