mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Fix delete button in Web UI
This commit is contained in:
@@ -48,10 +48,14 @@ window.addEvent('domready', function(){
|
|||||||
var cmd = '/command/delete';
|
var cmd = '/command/delete';
|
||||||
if($('deleteFromDiskCB').get('checked'))
|
if($('deleteFromDiskCB').get('checked'))
|
||||||
cmd = '/command/deletePerm';
|
cmd = '/command/deletePerm';
|
||||||
hashes.each(function(item, index){
|
new Request({url: cmd,
|
||||||
new Request({url: cmd, method: 'post', data: {hash: item}}).send();
|
method: 'post',
|
||||||
});
|
data: {hashes: hashes.join('|')},
|
||||||
window.parent.document.getElementById('confirmDeletionPage').parentNode.removeChild(window.parent.document.getElementById('confirmDeletionPage'));
|
onComplete: function() {
|
||||||
|
window.parent.document.getElementById('confirmDeletionPage').parentNode.removeChild(window.parent.document.getElementById('confirmDeletionPage'));
|
||||||
|
}
|
||||||
|
}).send();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -506,11 +506,17 @@ void HttpConnection::respondCommand(QString command)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(command == "delete") {
|
if(command == "delete") {
|
||||||
emit deleteTorrent(parser.post("hash"), false);
|
QStringList hashes = parser.post("hashes").split("|");
|
||||||
|
foreach(const QString &hash, hashes) {
|
||||||
|
emit deleteTorrent(hash, false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(command == "deletePerm") {
|
if(command == "deletePerm") {
|
||||||
emit deleteTorrent(parser.post("hash"), true);
|
QStringList hashes = parser.post("hashes").split("|");
|
||||||
|
foreach(const QString &hash, hashes) {
|
||||||
|
emit deleteTorrent(hash, true);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(command == "increasePrio") {
|
if(command == "increasePrio") {
|
||||||
|
|||||||
Reference in New Issue
Block a user