summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();
}