summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web/js/deluge-all/details/DetailsPanel.js
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/ui/web/js/deluge-all/details/DetailsPanel.js')
-rw-r--r--deluge/ui/web/js/deluge-all/details/DetailsPanel.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/deluge/ui/web/js/deluge-all/details/DetailsPanel.js b/deluge/ui/web/js/deluge-all/details/DetailsPanel.js
index 382ae6815..7ff1ed7ba 100644
--- a/deluge/ui/web/js/deluge-all/details/DetailsPanel.js
+++ b/deluge/ui/web/js/deluge-all/details/DetailsPanel.js
@@ -1,7 +1,7 @@
/*!
* Deluge.details.DetailsPanel.js
- *
- * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
+ *
+ * Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,12 +29,12 @@
* this exception statement from your version. If you delete this exception
* statement from all source files in the program, then also delete it here.
*/
-Ext.namespace('Deluge.details');
/**
* @class Deluge.details.DetailsPanel
*/
-Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
+Ext.define('Deluge.details.DetailsPanel', {
+ extend: 'Ext.tab.Panel',
region: 'south',
id: 'torrentDetails',
@@ -44,16 +44,16 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
collapsible: true,
margins: '0 5 5 5',
activeTab: 0,
-
+
initComponent: function() {
- Deluge.details.DetailsPanel.superclass.initComponent.call(this);
+ this.callParent(arguments);
this.add(new Deluge.details.StatusTab());
this.add(new Deluge.details.DetailsTab());
this.add(new Deluge.details.FilesTab());
this.add(new Deluge.details.PeersTab());
this.add(new Deluge.details.OptionsTab());
},
-
+
clear: function() {
this.items.each(function(panel) {
if (panel.clear) {
@@ -62,42 +62,42 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
}
});
},
-
-
+
+
update: function(tab) {
var torrent = deluge.torrents.getSelected();
if (!torrent) {
this.clear();
return;
}
-
+
this.items.each(function(tab) {
if (tab.disabled) tab.enable();
});
-
+
tab = tab || this.getActiveTab();
if (tab.update) tab.update(torrent.id);
},
-
+
/* Event Handlers */
-
+
// We need to add the events in onRender since Deluge.Torrents hasn't
// been created yet.
onRender: function(ct, position) {
- Deluge.details.DetailsPanel.superclass.onRender.call(this, ct, position);
+ this.callParent(arguments);
deluge.events.on('disconnect', this.clear, this);
deluge.torrents.on('rowclick', this.onTorrentsClick, this);
this.on('tabchange', this.onTabChange, this);
-
+
deluge.torrents.getSelectionModel().on('selectionchange', function(selModel) {
if (!selModel.hasSelection()) this.clear();
}, this);
},
-
+
onTabChange: function(panel, tab) {
this.update(tab);
},
-
+
onTorrentsClick: function(grid, rowIndex, e) {
this.update();
}