Module: deluge Branch: extjs4-port Commit: 201d337dbe8971b68b46896ea5bbbe16e32b522c
Author: Damien Churchill <[email protected]> Date: Mon Oct 3 21:58:16 2011 +0100 webui: fix displaying the torrent context menu The event name and arguments has changed, as well as the response from getPoint, nothing major. --- deluge/ui/web/js/deluge-all/TorrentGrid.js | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js index bbd8adc..827d79b 100644 --- a/deluge/ui/web/js/deluge-all/TorrentGrid.js +++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js @@ -252,14 +252,7 @@ Ext.define('Deluge.TorrentGrid', { deluge.events.on('torrentRemoved', this.onTorrentRemoved, this); deluge.events.on('disconnect', this.onDisconnect, this); - this.on('rowcontextmenu', function(grid, rowIndex, e) { - e.stopEvent(); - var selection = grid.getSelectionModel(); - if (!selection.hasSelection()) { - selection.selectRow(rowIndex); - } - deluge.menus.torrent.showAt(e.getPoint()); - }); + this.on('itemcontextmenu', this.onTorrentSelected, this); }, /** @@ -370,5 +363,15 @@ Ext.define('Deluge.TorrentGrid', { this.getStore().remove(record); delete this.torrents[torrentId]; }, this); + }, + + onTorrentSelected: function(grid, record, item, i, e, opts) { + e.stopEvent(); + var sm = grid.getSelectionModel(); + if (!sm.hasSelection()) { + sm.select(record); + } + var point = e.getPoint(); + deluge.menus.torrent.showAt(point.x, point.y); } }); -- 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.
