Sha256: d4b832acd77fa87c18e0fea675b61d7af6c172c5dff0b778c6425f15e3377bf8
Contents?: true
Size: 937 Bytes
Versions: 211
Compression:
Stored size: 937 Bytes
Contents
HAL.Views.EmbeddedResources = Backbone.View.extend({ initialize: function(opts) { this.vent = opts.vent; _.bindAll(this, 'render'); }, className: 'embedded-resources accordion', render: function(resources) { var self = this, resourceViews = [], buildView = function(resource) { return new HAL.Views.EmbeddedResource({ resource: resource, vent: self.vent }); }; _.each(resources, function(prop) { if ($.isArray(prop)) { _.each(prop, function(resource) { resourceViews.push(buildView(resource)); }); } else { resourceViews.push(buildView(prop)); } }); this.$el.html(this.template()); _.each(resourceViews, function(view) { view.render(); self.$el.append(view.el); }); return this; }, template: _.template($('#embedded-resources-template').html()) });
Version data entries
211 entries across 211 versions & 1 rubygems