BUGFIX: Fix priority up/down for multiple torrents at the same time (closes #692184)

This commit is contained in:
Christophe Dumez
2010-12-19 13:46:13 +00:00
parent 8c854b8a0e
commit c06386126b
6 changed files with 116 additions and 26 deletions

View File

@@ -204,7 +204,7 @@ initializeWindows = function(){
}
};
['pause','resume','decreasePrio','increasePrio', 'topPrio', 'bottomPrio', 'recheck'].each(function(item) {
['pause','resume', 'recheck'].each(function(item) {
addClickEvent(item, function(e){
new Event(e).stop();
var h = myTable.selectedIds();
@@ -220,13 +220,18 @@ initializeWindows = function(){
new Request({url: '/command/'+item+'all'}).send();
});
});
['decreasePrio','increasePrio', 'topPrio', 'bottomPrio'].each(function(item) {
addClickEvent(item, function(e){
new Event(e).stop();
setPriorityFN(item);
});
});
setPriorityFN = function(cmd) {
var h = myTable.selectedIds();
if(h.length){
h.each(function(hash, index){
new Request({url: '/command/'+cmd, method: 'post', data: {hash: hash}}).send();
});
if(h.length) {
new Request({url: '/command/'+cmd, method: 'post', data: {hashes: h.join("|")}}).send();
}
}