Sha256: e5279e6f68dae92e5d073163d700dc2966a46fe7713587fe0c97e38932476671
Contents?: true
Size: 1015 Bytes
Versions: 11
Compression:
Stored size: 1015 Bytes
Contents
var FileView = Backbone.View.extend({ tagName: 'li', className: 'span2', events: { "click .delete": "delete" }, 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(); } });
Version data entries
11 entries across 11 versions & 2 rubygems