Sha256: 36fc46d5822d5277b3c0c468eceb0499192c7b4afcc2621f5a1f0098dccecf28
Contents?: true
Size: 1.1 KB
Versions: 24
Compression:
Stored size: 1.1 KB
Contents
var FileView = Backbone.View.extend({ tagName: 'li', className: 'span2', events: { "click .delete": "delete", "click .photo-link": "photo_link", }, initialize: function(){ this.template = JST['photo_view'] this.model.on('change', this.render, this); this.model.on('uploadCompleted', this.removeProgressBar, this); }, removeProgressBar: function(){ if(this.$el != undefined) this.$el.find('.progress').fadeOut(); }, render : function(){ var data = _.defaults(this.model.attributes, {progress: null, id: null, title: null}) var html = this.template(this.model.attributes); $(this.el).html(html); return this; }, delete: function(e) { e.preventDefault(); this.model.destroy({ success: function(model, response){ console.log("Success"); }, error: function(model, response){ console.log("Error"); } }); this.$el.fadeOut(); }, photo_link: function(e) { e.preventDefault(); } });
Version data entries
24 entries across 24 versions & 2 rubygems