select a row if there is no row selected when contextmenu is clicked

This commit is contained in:
Damien Churchill 2009-03-20 17:26:24 +00:00
parent 4852188ce9
commit bccb7ca66e
1 changed files with 4 additions and 0 deletions

View File

@ -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());
}
}