Sha256: 0fa74a83b7adfddd7a72f59a450113a4ccfaff1b7320883db0fd306b6ad8713e
Contents?: true
Size: 1.35 KB
Versions: 120
Compression:
Stored size: 1.35 KB
Contents
HAL.Views.EmbeddedResource = Backbone.View.extend({ initialize: function(opts) { this.vent = opts.vent; this.resource = opts.resource; this.propertiesView = new HAL.Views.Properties({}); this.linksView = new HAL.Views.Links({ vent: this.vent }); _.bindAll(this, 'onToggleClick'); _.bindAll(this, 'onDoxClick'); }, events: { 'click a.accordion-toggle': 'onToggleClick', 'click span.dox': 'onDoxClick' }, className: 'embedded-resource accordion-group', onToggleClick: function(e) { e.preventDefault(); this.$accordionBody.collapse('toggle'); }, onDoxClick: function(e) { e.preventDefault(); this.vent.trigger('show-docs', { url: $(e.currentTarget).data('href') }); return false; }, render: function() { this.$el.empty(); this.linksView.render(this.resource.links); this.propertiesView.render(this.resource.toJSON()); this.$el.append(this.template({ resource: this.resource })); var $inner = $('<div class="accordion-inner"></div>'); $inner.append(this.linksView.el); $inner.append(this.propertiesView.el); this.$accordionBody = $('<div class="accordion-body collapse"></div>'); this.$accordionBody.append($inner) this.$el.append(this.$accordionBody); }, template: _.template($('#embedded-resource-template').html()) });
Version data entries
120 entries across 120 versions & 1 rubygems