diff options
author | 2013-03-05 19:05:23 +0100 | |
---|---|---|
committer | 2013-03-05 19:05:23 +0100 | |
commit | 33f9e7fb68d58e43e1188409b43e550c9ed4b54d (patch) | |
tree | 0ae97eef3ecedd7fee26ea7e98d117f9ccd53df6 /module/web/static/js/views/selectionView.js | |
parent | functions to render file status, only simple coloring for now (diff) | |
download | pyload-33f9e7fb68d58e43e1188409b43e550c9ed4b54d.tar.xz |
cleaned dashboard event code, preserve filtering across packages
Diffstat (limited to 'module/web/static/js/views/selectionView.js')
-rw-r--r-- | module/web/static/js/views/selectionView.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/module/web/static/js/views/selectionView.js b/module/web/static/js/views/selectionView.js index eaed33d59..2237c5f92 100644 --- a/module/web/static/js/views/selectionView.js +++ b/module/web/static/js/views/selectionView.js @@ -13,23 +13,21 @@ define(['jquery', 'backbone', 'underscore', 'app'], 'click .iconf-refresh': 'restart' }, - // available packages - tree: null, // Element of the action bar actionBar: null, // number of currently selected elements current: 0, - initialize: function(tree) { - this.tree = tree; + initialize: function() { + var render = _.bind(this.render, this); - App.vent.on('dashboard:show', _.bind(this.render, this)); - App.vent.on('package:selection', _.bind(this.render, this)); - App.vent.on('file:selection', _.bind(this.render, this)); + App.vent.on('dashboard:updated', render); + App.vent.on('dashboard:filtered', render); + App.vent.on('package:selection', render); + App.vent.on('file:selection', render); this.actionBar = $('.actionbar .btn-check'); this.actionBar.parent().click(_.bind(this.select_toggle, this)); - // TODO when something gets deleted // this.tree.get('packages').on('delete', _.bind(this.render, this)); }, @@ -46,7 +44,7 @@ define(['jquery', 'backbone', 'underscore', 'app'], }, get_packs: function() { - return this.tree.get('packages').where({selected: true}); + return App.dashboard.tree.get('packages').where({selected: true}); }, render: function() { |