use inline if/else to set the value of auto managed and also run through gettext

This commit is contained in:
Damien Churchill 2009-06-01 20:13:05 +00:00
parent e71c562612
commit 87355e0490
2 changed files with 5 additions and 5 deletions

View File

@ -45,6 +45,7 @@ Ext.deluge.details.StatusTab = Ext.extend(Ext.Panel, {
this.status = this.add({ this.status = this.add({
cls: 'x-deluge-status', cls: 'x-deluge-status',
id: 'deluge-details-status',
border: false, border: false,
listeners: { listeners: {
'render': { 'render': {
@ -62,11 +63,11 @@ Ext.deluge.details.StatusTab = Ext.extend(Ext.Panel, {
}, },
clear: function() { clear: function() {
if (!this.fields) return;
this.progressBar.updateProgress(0, ' '); this.progressBar.updateProgress(0, ' ');
for (var k in this.fields) { for (var k in this.fields) {
this.fields[k].innerHTML = ''; this.fields[k].innerHTML = '';
} }
this.disable();
}, },
update: function(torrentId) { update: function(torrentId) {
@ -103,10 +104,9 @@ Ext.deluge.details.StatusTab = Ext.extend(Ext.Panel, {
active_time: ftime(status.active_time), active_time: ftime(status.active_time),
seeding_time: ftime(status.seeding_time), seeding_time: ftime(status.seeding_time),
seed_rank: status.seed_rank, seed_rank: status.seed_rank,
auto_managed: 'False',
time_added: fdate(status.time_added) time_added: fdate(status.time_added)
} }
if (status.is_auto_managed) {data.auto_managed = 'True'} data.auto_managed = _((status.is_auto_managed) ? 'True' : 'False');
for (var field in this.fields) { for (var field in this.fields) {
this.fields[field].innerHTML = data[field]; this.fields[field].innerHTML = data[field];
@ -115,4 +115,4 @@ Ext.deluge.details.StatusTab = Ext.extend(Ext.Panel, {
this.progressBar.updateProgress(status.progress, text); this.progressBar.updateProgress(status.progress, text);
} }
}); });
Deluge.Details.add(new Ext.deluge.details.StatusTab()); Deluge.Details.add(new Ext.deluge.details.StatusTab());

File diff suppressed because one or more lines are too long