diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-18 19:04:48 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-03-18 19:04:48 +0100 |
commit | 5d32c05eb764beed8a84dec1e91e0f8a8060899d (patch) | |
tree | d4d71b48908c097bde2a3ec9c7c2b80d54b5eccd /module/web/static/js/views/headerView.js | |
parent | render download progress (diff) | |
download | pyload-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.js | 12 |
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(); }, |