mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 21:38:51 +03:00
Add ability to use 'shift+delete' to delete torrents in WebUI
Closes #13827.
This commit is contained in:
parent
9c938b91b7
commit
d46343fb9c
3 changed files with 9 additions and 2 deletions
|
@ -11,6 +11,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
|
const isDeletingFiles = (new URI().getData('deleteFiles') === "true");
|
||||||
|
$('deleteFromDiskCB').checked = isDeletingFiles;
|
||||||
|
|
||||||
const hashes = new URI().getData('hashes').split('|');
|
const hashes = new URI().getData('hashes').split('|');
|
||||||
$('cancelBtn').focus();
|
$('cancelBtn').focus();
|
||||||
$('cancelBtn').addEvent('click', function(e) {
|
$('cancelBtn').addEvent('click', function(e) {
|
||||||
|
|
|
@ -1225,6 +1225,10 @@ new Keyboard({
|
||||||
'delete': function(event) {
|
'delete': function(event) {
|
||||||
deleteFN();
|
deleteFN();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
},
|
||||||
|
'shift+delete': (event) => {
|
||||||
|
deleteFN(true);
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).activate();
|
}).activate();
|
||||||
|
|
|
@ -376,14 +376,14 @@ const initializeWindows = function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
deleteFN = function() {
|
deleteFN = function(deleteFiles = false) {
|
||||||
const hashes = torrentsTable.selectedRowsIds();
|
const hashes = torrentsTable.selectedRowsIds();
|
||||||
if (hashes.length) {
|
if (hashes.length) {
|
||||||
new MochaUI.Window({
|
new MochaUI.Window({
|
||||||
id: 'confirmDeletionPage',
|
id: 'confirmDeletionPage',
|
||||||
title: "QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=confirmDeletionDlg]",
|
title: "QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=confirmDeletionDlg]",
|
||||||
loadMethod: 'iframe',
|
loadMethod: 'iframe',
|
||||||
contentURL: 'confirmdeletion.html?hashes=' + hashes.join("|"),
|
contentURL: ('confirmdeletion.html?hashes=' + hashes.join("|") + '&deleteFiles=' + deleteFiles),
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
Loading…
Reference in a new issue