-define([\r
-'libs/text!./template.html',\r
-'libs/jquery-1.9.1.min',\r
-'libs/underscore-min',\r
-\r
-], function(templateSrc, $, _) {\r
-\r
-'use strict';\r
-\r
-return function(sandbox) {\r
- \r
- var view = $(_.template(templateSrc)());\r
- \r
- view.on('change', 'select', function(e) {\r
- var target = $(e.target);\r
- var attr = target.attr('class').split('-')[3] === 'tagSelect' ? 'tag' : 'class';\r
- sandbox.publish('nodeChanged', attr, target.val());\r
- });\r
- \r
- return {\r
- start: function() {\r
- sandbox.publish('ready');\r
- },\r
- getView: function() {\r
- return view;\r
- },\r
- setNode: function(canvasNode) {\r
- view.find('.rng-module-nodePane-tagSelect').val(canvasNode.getTag());\r
- view.find('.rng-module-nodePane-classSelect').val(canvasNode.getClass());\r
- }\r
- }\r
- \r
-}\r
-\r
+define([
+'libs/text!./template.html',
+'libs/jquery-1.9.1.min',
+'libs/underscore-min',
+'modules/nodePane/metaWidget/metaWidget'
+], function(templateSrc, $, _, metaWidget) {
+
+'use strict';
+
+return function(sandbox) {
+
+ var view = $(_.template(templateSrc)());
+
+ 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());
+ });
+
+ return {
+ start: function() {
+ sandbox.publish('ready');
+ },
+ getView: function() {
+ return view;
+ },
+ 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);
+ }
+ };
+
+};
+