Skip to content

Commit

Permalink
improved change_selected_pos
Browse files Browse the repository at this point in the history
  • Loading branch information
eroamane authored Jun 3, 2020
1 parent 46eef96 commit e236a4e
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions js/aria2.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,23 +511,20 @@ if (typeof ARIA2=="undefined"||!ARIA2) var ARIA2=(function(){
}
);
},

change_selected_pos: function(gids, pos, how) {
for (var gid of gids) {
new Promise(function(resolve) {
ARIA2.request("changePosition", [gid, pos, how],
function(result) {
//console.debug(result);

if (gid == gids[gids.length -1]) {
main_alert("alert-info", "Moved", 1000);
ARIA2.refresh();
}
resolve();
}
);
})
}
var params = [];
$.each(gids, function(i, n) {
params.push([n, pos, how]);
});
ARIA2.batch_request("changePosition", params,
function(result) {
//console.debug(result);

main_alert("alert-info", "Moved", 1000);
ARIA2.refresh();
}
);
},

pause: function(gids) {
Expand Down

0 comments on commit e236a4e

Please sign in to comment.