diff options
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() { |