webui: fix displaying the torrent context menu

The event name and arguments has changed, as well as the response
from getPoint, nothing major.
This commit is contained in:
Damien Churchill 2011-10-03 21:58:16 +01:00
parent 43cb787b44
commit 08e774bbda
1 changed files with 11 additions and 8 deletions

View File

@ -256,14 +256,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);
},
/**
@ -374,5 +367,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);
}
});