Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderSummary: function() {
var template = Form.templates['bootstrap.ListObject'];
this.$el.html(template({
summary: this.getStringValue()
}));
},
var Form = Backbone.Form,
editors = Form.editors;
Form.setTemplates({
'bootstrap.ListObject': '\
<div style="cursor: pointer; border: 1px solid #ccc; width: 208px; border-radius: 3px; padding: 4px; color: #555">\
{{summary}}\
</div>\
'
});
/**
* Modal object editor for use with the List editor.
* To use it, set the 'itemType' property in a List schema to 'bootstrap.ListObject'
*/
editors['bootstrap.ListObject'] = editors['bootstrap.ListNestedModel'] = editors.Base.extend({
events: {
'click': 'openEditor'
},
/**
* @param {Object} options
* @param {String} [options.schema.itemType] Item editor type: 'List.Object' | 'List.NestedModel'
* @param {Object} [options.schema.subSchema] Schema for nested form,. Required when itemType is 'Object'
* @param {Function} [options.schema.model] Model constructor function. Required when itemType is 'NestedModel'
*/
initialize: function(options) {
editors.Base.prototype.initialize.call(this, options);
//Dependencies
if (!Backbone.BootstrapModal) throw new Error('Backbone.BootstrapModal is required');