From bccb7ca66eef426c4f9b9a793220e847681a9234 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 20 Mar 2009 17:26:24 +0000 Subject: [PATCH] select a row if there is no row selected when contextmenu is clicked --- deluge/ui/web/js/deluge-torrents.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deluge/ui/web/js/deluge-torrents.js b/deluge/ui/web/js/deluge-torrents.js index cd1dad482..ca55c7504 100644 --- a/deluge/ui/web/js/deluge-torrents.js +++ b/deluge/ui/web/js/deluge-torrents.js @@ -125,6 +125,10 @@ Deluge.Torrents.Grid = new Ext.grid.GridPanel({ 'rowcontextmenu': { fn: function(grid, rowIndex, e) { e.stopEvent(); + var selection = grid.getSelectionModel(); + if (!selection.hasSelection()) { + selection.selectRow(rowIndex); + } Deluge.Menus.Torrent.showAt(e.getPoint()); } }