Vvveb.Components.extend("_base", "html/label", {
name: "Label",
image: "icons/label.svg",
nodes: ["label"],
html: '<div class="form-group"><label for="">Label</label></div>',
beforeInit: function (node) {
properties = [];
var $node = $(node);
var caption = $node.text();
data = {"caption": caption};
properties.push({
name: "Caption",
key: "caption",
inputtype: TextInput,
data: data,
onChange: function (node, value, input) {
$node.text(value);
Vvveb.Components.render("html/label");
return node;
},
});
//remove all option properties
this.properties = this.properties.filter(function (item) {
return item.key.indexOf("caption") === -1;
});
//add remaining properties to generated column properties
for (var i = 0; i < this.properties.length; i++) {
properties.push(this.properties[i]);
}
this.properties = properties;
return node;
},
properties: [
{
name: "Caption",
key: "caption",
inputtype: TextInput
}, {
name: "For ID",
htmlAttr: "for",
key: "for",
inputtype: TextInput
}]
});