Renaming properties templates
This commit is contained in:
parent
8a96f06df4
commit
75ecd91593
|
@ -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': "",
|
||||
|
|
|
@ -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))
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue