summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/headerView.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-18 19:04:48 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-18 19:04:48 +0100
commit5d32c05eb764beed8a84dec1e91e0f8a8060899d (patch)
treed4d71b48908c097bde2a3ec9c7c2b80d54b5eccd /module/web/static/js/views/headerView.js
parentrender download progress (diff)
downloadpyload-5d32c05eb764beed8a84dec1e91e0f8a8060899d.tar.xz
added ReadWrite lock, render file progress on dashboard
Diffstat (limited to 'module/web/static/js/views/headerView.js')
-rw-r--r--module/web/static/js/views/headerView.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/module/web/static/js/views/headerView.js b/module/web/static/js/views/headerView.js
index dddae4705..d9c56b332 100644
--- a/module/web/static/js/views/headerView.js
+++ b/module/web/static/js/views/headerView.js
@@ -6,7 +6,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'colle
el: 'header',
events: {
- 'click i.iconf-list': 'toggle_taskList',
+ 'click .iconf-list': 'toggle_taskList',
'click .popover .close': 'hide_taskList',
'click .btn-grabber': 'open_grabber'
},
@@ -169,6 +169,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'colle
},
onProgressUpdate: function(progress) {
+ // generate a unique id
_.each(progress, function(prog) {
if (prog.download)
prog.pid = prog.download.fid;
@@ -177,6 +178,15 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'colle
});
this.progressList.update(progress);
+ // update currently open files with progress
+ this.progressList.each(function(prog) {
+ if(prog.isDownload() && App.dashboard.files){
+ var file = App.dashboard.files.get(prog.get('download').fid);
+ if (file)
+ file.set('progress', prog.getPercent());
+ }
+ });
+ // TODO: only render when changed
this.render();
},