diff options
author | 2012-12-23 20:10:01 +0100 | |
---|---|---|
committer | 2012-12-23 20:10:01 +0100 | |
commit | b18fa59e40ebe9c03f81d49cf53a85bc728de8a7 (patch) | |
tree | cf28b8bb661cbb95592be89177cf82a325a0f6ea /module/web/static/js/views/fileView.js | |
parent | cleaned the settings page (diff) | |
download | pyload-b18fa59e40ebe9c03f81d49cf53a85bc728de8a7.tar.xz |
proper selecting, expanding and rendering of packageViews
Diffstat (limited to 'module/web/static/js/views/fileView.js')
-rw-r--r-- | module/web/static/js/views/fileView.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/web/static/js/views/fileView.js b/module/web/static/js/views/fileView.js index f020a69d4..7e8f899a9 100644 --- a/module/web/static/js/views/fileView.js +++ b/module/web/static/js/views/fileView.js @@ -1,7 +1,8 @@ -define(['jquery', 'backbone', 'underscore', 'app'], function($, Backbone, _, App) { +define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'], + function($, Backbone, _, App, ItemView) { // Renders single file item - return Backbone.View.extend({ + return ItemView.extend({ tagName: 'li', className: 'file-view', @@ -12,6 +13,13 @@ define(['jquery', 'backbone', 'underscore', 'app'], function($, Backbone, _, App }, initialize: function() { + this.model.on('change', this.render, this); + this.model.on('remove', this.destroy, this); + }, + + onDestroy: function() { + this.model.off('change', this.render); + this.model.off('remove', this.destroy); }, render: function() { |