CanvasNode.prototype.getMetaAttr = function(attr) {
return this.dom.attr('wlxml-meta-'+attr);
-}
+};
CanvasNode.prototype.getMetaAttrs = function() {
var toret = [];
}
}
return toret;
-}
+};
CanvasNode.prototype.setMetaAttr = function(attr, value) {
this.dom.attr('wlxml-meta-'+attr, value);
-}
+};
return {
create: function(desc) {
manager.currentNode.setMetaAttr(attr, value);
}
sandbox.publish('contentChanged');
+ sandbox.publish('currentNodeChanged', manager.currentNode);
}
},
highlightNode: function(canvasNode) {
var node = canvasNode.create({tag: 'tag', meta: {a:'1'}});
node.setMetaAttr('a', '2');
assert.equal(node.dom.attr('wlxml-meta-a'), '2');
- })
-})
+ });
+});
});
\ No newline at end of file
var templates = {
string: _.template(stringFieldTpl)
-}
+};
var getAttrElement = function(attr) {
var toret = $('<div>');
toret.append(templates.string({name: attr.name, value: attr.value}));
return toret;
-}
+};
var MetaWidget = Backbone.View.extend({
events: {
var view = this;
this.options.attrs.forEach(function(attr) {
view.$el.append(getAttrElement(attr));
- })
+ });
},
onMetaFieldChange: function(e) {
var target = $(e.target);
create: function(options) {
return new MetaWidget(options);
}
-}
+};
});
\ No newline at end of file