summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/views/dashboard
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-12-01 21:06:17 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-12-01 21:06:17 +0100
commitfdb98aba01a9cbf415526d796a24d372fd00419a (patch)
treeda9c9c3138d727bc282ca2db618dc4b56ec62f30 /pyload/web/app/scripts/views/dashboard
parentfixed are few addons and improved crypter workarounds (diff)
downloadpyload-fdb98aba01a9cbf415526d796a24d372fd00419a.tar.xz
fixed cnl, packages now pausable
Diffstat (limited to 'pyload/web/app/scripts/views/dashboard')
-rw-r--r--pyload/web/app/scripts/views/dashboard/dashboardView.js11
-rw-r--r--pyload/web/app/scripts/views/dashboard/packageView.js5
2 files changed, 12 insertions, 4 deletions
diff --git a/pyload/web/app/scripts/views/dashboard/dashboardView.js b/pyload/web/app/scripts/views/dashboard/dashboardView.js
index d98e28fe3..6a263bf03 100644
--- a/pyload/web/app/scripts/views/dashboard/dashboardView.js
+++ b/pyload/web/app/scripts/views/dashboard/dashboardView.js
@@ -28,10 +28,8 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'col
var self = this;
// When package is added we reload the data
- this.listenTo(App.vent, 'package:added', function() {
- console.log('Package tree caught, package:added event');
- self.tree.fetch();
- });
+ this.listenTo(App.vent, 'package:added', _.bind(this.fetch, this));
+ this.listenTo(App.vent, 'package:inserted', _.bind(this.fetch, this));
this.listenTo(App.vent, 'file:updated', _.bind(this.fileUpdated, this));
@@ -59,6 +57,11 @@ define(['jquery', 'backbone', 'underscore', 'app', 'models/TreeCollection', 'col
this.$('.input').select2({tags: ['a', 'b', 'sdf']});
},
+ fetch: function() {
+ console.log('Fetching package tree');
+ this.tree.fetch();
+ },
+
update: function() {
console.log('Update package list');
diff --git a/pyload/web/app/scripts/views/dashboard/packageView.js b/pyload/web/app/scripts/views/dashboard/packageView.js
index 1bb250f27..243ebac9b 100644
--- a/pyload/web/app/scripts/views/dashboard/packageView.js
+++ b/pyload/web/app/scripts/views/dashboard/packageView.js
@@ -11,6 +11,7 @@ define(['jquery', 'app', 'views/abstract/itemView', 'underscore', 'hbs!tpl/dashb
events: {
'click .package-name, .btn-open': 'open',
'click .icon-refresh': 'restart',
+ 'click .toggle-paused': 'pause',
'click .select': 'select',
'click .icon-chevron-down': 'loadMenu',
'click .btn-delete': 'deleteItem',
@@ -68,6 +69,10 @@ define(['jquery', 'app', 'views/abstract/itemView', 'underscore', 'hbs!tpl/dashb
App.dashboard.openPackage(this.model);
},
+ pause: function(e) {
+ this.model.togglePaused();
+ },
+
select: function(e) {
e.preventDefault();
var checked = this.$('.select').hasClass('icon-check');