mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
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:
parent
43cb787b44
commit
08e774bbda
1 changed files with 11 additions and 8 deletions
|
@ -256,14 +256,7 @@ Ext.define('Deluge.TorrentGrid', {
|
||||||
deluge.events.on('torrentRemoved', this.onTorrentRemoved, this);
|
deluge.events.on('torrentRemoved', this.onTorrentRemoved, this);
|
||||||
deluge.events.on('disconnect', this.onDisconnect, this);
|
deluge.events.on('disconnect', this.onDisconnect, this);
|
||||||
|
|
||||||
this.on('rowcontextmenu', function(grid, rowIndex, e) {
|
this.on('itemcontextmenu', this.onTorrentSelected, this);
|
||||||
e.stopEvent();
|
|
||||||
var selection = grid.getSelectionModel();
|
|
||||||
if (!selection.hasSelection()) {
|
|
||||||
selection.selectRow(rowIndex);
|
|
||||||
}
|
|
||||||
deluge.menus.torrent.showAt(e.getPoint());
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -374,5 +367,15 @@ Ext.define('Deluge.TorrentGrid', {
|
||||||
this.getStore().remove(record);
|
this.getStore().remove(record);
|
||||||
delete this.torrents[torrentId];
|
delete this.torrents[torrentId];
|
||||||
}, this);
|
}, 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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue