diff --git a/examples/10_templates.html b/examples/10_templates.html
index 3e45f90..68b5721 100644
--- a/examples/10_templates.html
+++ b/examples/10_templates.html
@@ -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': "",
diff --git a/src/js/Node.js b/src/js/Node.js
index b762a5b..6566300 100644
--- a/src/js/Node.js
+++ b/src/js/Node.js
@@ -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))
});
});
};