Renaming properties templates

This commit is contained in:
Israel Garcia 2017-05-23 20:06:07 -04:00
parent 715343b028
commit 1b998c5b1a
2 changed files with 13 additions and 10 deletions

View File

@ -39,18 +39,21 @@
var options = {
templates: [
{
menu: 'Person',
name: 'PersonTemplate',
data: {
text: 'Person',
title: 'Insert a Person Node',
className: 'jsoneditor-type-object',
field: 'PersonTemplate',
value: {
'firstName': 'John',
'lastName': 'Do',
'age': 28
}
},
{
menu: 'Address',
name: 'AddressTemplate',
data: {
text: 'Address',
title: 'Insert a Address Node',
field: 'AddressTemplate',
value: {
'street': "",
'city': "",
'state': "",

View File

@ -3193,10 +3193,10 @@ Node.prototype.addTemplates = function (menu, append) {
};
templates.forEach(function (template) {
menu.push({
text: template.menu,
className: (template.class || 'jsoneditor-type-object'),
title: template.menu,
click: (append ? appendData.bind(this, template.name, template.data) : insertData.bind(this, template.name, template.data))
text: template.text,
className: (template.className || 'jsoneditor-type-object'),
title: template.title,
click: (append ? appendData.bind(this, template.field, template.value) : insertData.bind(this, template.field, template.value))
});
});
};