summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/fileView.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-19 22:13:10 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-02-19 22:13:10 +0100
commitc8bee03f8c0ca82c3981724e5bc661f630d9ab7e (patch)
treec81e552b54c210e74637437fd4eeca72eb24f510 /module/web/static/js/views/fileView.js
parentadded shadow to package box (diff)
downloadpyload-c8bee03f8c0ca82c3981724e5bc661f630d9ab7e.tar.xz
integrated new package view
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');
}
});