diff options
| author | 2013-02-19 22:13:10 +0100 | |
|---|---|---|
| committer | 2013-02-19 22:13:10 +0100 | |
| commit | c8bee03f8c0ca82c3981724e5bc661f630d9ab7e (patch) | |
| tree | c81e552b54c210e74637437fd4eeca72eb24f510 /module/web/static/js/views/fileView.js | |
| parent | added shadow to package box (diff) | |
| download | pyload-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.js | 11 | 
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');          }      }); | 
