summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/fileView.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js/views/fileView.js')
-rw-r--r--module/web/static/js/views/fileView.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/module/web/static/js/views/fileView.js b/module/web/static/js/views/fileView.js
index 7e8f899a9..86f7b33d2 100644
--- a/module/web/static/js/views/fileView.js
+++ b/module/web/static/js/views/fileView.js
@@ -9,7 +9,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'],
// template: _.template($("#template-file").html()),
template: _.compile($("#template-file").html()),
events: {
-
+ 'click .checkbox': 'select'
},
initialize: function() {
@@ -25,6 +25,15 @@ define(['jquery', 'backbone', 'underscore', 'app', 'views/abstract/itemView'],
render: function() {
this.$el.html(this.template(this.model.toJSON()));
return this;
+ },
+
+ select: function(e) {
+ e.preventDefault();
+ var checked = this.$('.checkbox').hasClass('checked');
+ // toggle class immediately, so no re-render needed
+ this.model.set('selected', !checked, {silent: true});
+ this.$('.checkbox').toggleClass('checked');
+ App.vent.trigger('file:selection');
}
});