mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 19:26:59 +03:00
Fix delete button in Web UI
This commit is contained in:
parent
2955f9d82a
commit
93b295e8c4
2 changed files with 16 additions and 6 deletions
|
@ -48,10 +48,14 @@ window.addEvent('domready', function(){
|
|||
var cmd = '/command/delete';
|
||||
if($('deleteFromDiskCB').get('checked'))
|
||||
cmd = '/command/deletePerm';
|
||||
hashes.each(function(item, index){
|
||||
new Request({url: cmd, method: 'post', data: {hash: item}}).send();
|
||||
});
|
||||
window.parent.document.getElementById('confirmDeletionPage').parentNode.removeChild(window.parent.document.getElementById('confirmDeletionPage'));
|
||||
new Request({url: cmd,
|
||||
method: 'post',
|
||||
data: {hashes: hashes.join('|')},
|
||||
onComplete: function() {
|
||||
window.parent.document.getElementById('confirmDeletionPage').parentNode.removeChild(window.parent.document.getElementById('confirmDeletionPage'));
|
||||
}
|
||||
}).send();
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -506,11 +506,17 @@ void HttpConnection::respondCommand(QString command)
|
|||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
if(command == "increasePrio") {
|
||||
|
|
Loading…
Reference in a new issue