From 8b5b465231bde527037ff1cea3e99039250d0cc9 Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Fri, 16 May 2014 00:35:38 +0200 Subject: [PATCH] Confirm removal of downloads --- js/ctrls/download.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ctrls/download.js b/js/ctrls/download.js index c391130..d479694 100644 --- a/js/ctrls/download.js +++ b/js/ctrls/download.js @@ -38,14 +38,17 @@ function( // put it in stopped list if active, // otherwise permanantly remove it // d: the download ctx - scope.remove = function(d, cb) { + scope.remove = function(d, cb, noConfirm) { + if (!noConfirm && !confirm("Remove %s and associated meta-data?".replace("%s", d.name))) { + return; + } var method = 'remove'; if (scope.getType(d) == 'stopped') method = 'removeDownloadResult'; if (d.followedFrom) { - scope.remove(d.followedFrom, function() {}); + scope.remove(d.followedFrom, function() {}, true); d.followedFrom = null; } rpc.once(method, [d.gid], cb);