// Create an attachment composer for a collection
//
// Within the attachmentComposer, define the html for the fields the composer
// should display. Here, we’re assuming there’s a field on the slice called
// `myAttachments`.
//
// {{#attachmentComposer myAttachments}}
//
// {{/attachmentComposer}}
//
Handlebars.registerHelper('attachmentComposer', function(options) {
if (!options.hash) {
return new Handlebars.SafeString(
'' +
'DEPRECATION: Please use the new attachmentComposer syntax: ' +
'{{attachmentComposer field="example"}}' +
'
'
);
}
// Instantiate an AssetComposerView.
var composer = new slices.AttachmentComposerView({
id : slices.fieldId(this, options.hash.field),
collection : this[options.hash.field],
fields : options.fn,
autoAttach : true
});
// Return the placeholder. Don’t worry, this is replaced automatically later.
return new Handlebars.SafeString(composer.placeholder());
});
// Create a new AssetLibraryView and append it to the given `el`.
// If no `el` is given, render will write one in-place to the dom,
// and render it there.
//
// Rendering asset library at the current point in html
//
//
//
slices.renderAssetLibrary = function(options) {
options = options || {};
if (!options.el) {
document.write('