summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Churchill <damoxc@gmail.com>2011-10-04 18:34:14 +0100
committerDamien Churchill <damoxc@gmail.com>2011-10-05 01:36:58 +0100
commit713953ec0309b32053ae94107fe9331cbf1252c1 (patch)
tree73dd53ac36b8dea2271ff675efad4ac1e41c0fcc
parent632473703182f7c53393bb94256c88fef3ea59e4 (diff)
downloaddeluge-713953ec0309b32053ae94107fe9331cbf1252c1.tar.gz
deluge-713953ec0309b32053ae94107fe9331cbf1252c1.tar.bz2
deluge-713953ec0309b32053ae94107fe9331cbf1252c1.zip
web: fix the toolbar actions
Use the proper method for getting the torrent ids instead of the implementation within the toolbar. Using the one on the torrent grid will be more likely to work.
-rw-r--r--deluge/ui/web/js/deluge-all/Toolbar.js30
1 files changed, 13 insertions, 17 deletions
diff --git a/deluge/ui/web/js/deluge-all/Toolbar.js b/deluge/ui/web/js/deluge-all/Toolbar.js
index a95f2a381..0cdf6a27d 100644
--- a/deluge/ui/web/js/deluge-all/Toolbar.js
+++ b/deluge/ui/web/js/deluge-all/Toolbar.js
@@ -1,6 +1,6 @@
/*!
* Deluge.Toolbar.js
- *
+ *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -116,53 +116,49 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
connectedButtons: [
'add', 'remove', 'pause', 'resume', 'up', 'down'
],
-
+
initComponent: function() {
Deluge.Toolbar.superclass.initComponent.call(this);
deluge.events.on('connect', this.onConnect, this);
deluge.events.on('login', this.onLogin, this);
},
-
+
onConnect: function() {
Ext.each(this.connectedButtons, function(buttonId) {
this.items.get(buttonId).enable();
}, this);
},
-
+
onDisconnect: function() {
Ext.each(this.connectedButtons, function(buttonId) {
this.items.get(buttonId).disable();
}, this);
},
-
+
onLogin: function() {
this.items.get('logout').enable();
},
-
+
onLogout: function() {
this.items.get('logout').disable();
deluge.login.logout();
},
-
+
onConnectionManagerClick: function() {
deluge.connectionManager.show();
},
-
+
onHelpClick: function() {
window.open('http://dev.deluge-torrent.org/wiki/UserGuide');
},
-
+
onPreferencesClick: function() {
deluge.preferences.show();
},
-
+
onTorrentAction: function(item) {
- var selection = deluge.torrents.getSelections();
- var ids = [];
- Ext.each(selection, function(record) {
- ids.push(record.id);
- });
-
+ var ids = deluge.torrents.getSelectedIds();
+
switch (item.id) {
case 'remove':
deluge.removeWindow.show(ids);
@@ -185,7 +181,7 @@ Deluge.Toolbar = Ext.extend(Ext.Toolbar, {
break;
}
},
-
+
onTorrentAdd: function() {
deluge.add.show();
}