Module: deluge Branch: extjs4-port Commit: 1ae35c418fad35990fe90250238ab9e394a66bd9
Author: Damien Churchill <[email protected]> Date: Tue Oct 4 18:34:14 2011 +0100 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. --- deluge/ui/web/js/deluge-all/Toolbar.js | 30 +++++++++++++----------------- 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 a95f2a3..0cdf6a2 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 <[email protected]> * * 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(); } -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
