fix the progress bar in the grid

This commit is contained in:
Damien Churchill 2010-01-28 22:49:56 +00:00
parent da8367de4d
commit 1d29f67a75
1 changed files with 5 additions and 7 deletions

View File

@ -47,8 +47,9 @@ Copyright:
function torrentProgressRenderer(value, p, r) { function torrentProgressRenderer(value, p, r) {
value = new Number(value); value = new Number(value);
var progress = value; var progress = value;
var text = r.data['state'] + ' ' + value.toFixed(2) + '%' var text = r.data['state'] + ' ' + value.toFixed(2) + '%';
return Deluge.progressBar(value, this.width - 8, text); var width = new Number(this.style.match(/\w+:\s*(\d+)\w+/)[1]);
return Deluge.progressBar(value, width - 8, text);
} }
function seedsRenderer(value, p, r) { function seedsRenderer(value, p, r) {
if (r.data['total_seeds'] > -1) { if (r.data['total_seeds'] > -1) {
@ -243,11 +244,8 @@ Copyright:
}, },
update: function(torrents, bulk) { update: function(torrents, bulk) {
if (bulk) { var store = this.getStore();
this.getStore().loadData({"torrents": Ext.values(torrents)}); store.loadData({"torrents": Ext.values(torrents)});
} else {
this.getStore().loadData({"torrents": Ext.values(torrents)});
}
}, },
onDisconnect: function() { onDisconnect: function() {