diff --git a/public/css/style.css b/public/css/style.css index ae25c12..2eb4cd5 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -259,6 +259,15 @@ div#download_tab{ display: block; } +.download_object > .download_bar{ + display: flex; + align-items: center; + height: 24px; +} +.download_object > .download_bar > .progress{ + margin: 0px; +} + /* Global stuff */ img.rounded { border-radius: 5px; diff --git a/public/js/downloadList.js b/public/js/downloadList.js index 6468507..3679e25 100644 --- a/public/js/downloadList.js +++ b/public/js/downloadList.js @@ -16,10 +16,33 @@ socket.on("addedToQueue", function(queueItem){ 0/${queueItem.size} -
+
+
+ remove +
`) }) +function downloadAction(evt){ + let icon = $(evt.currentTarget).text() + let uuid = $(evt.currentTarget).data("uuid") + switch (icon) { + case 'remove': + socket.emit('removeFromQueue', uuid) + break; + default: + } +} + +socket.on("removedFromQueue", function(uuid){ + let index = queue.indexOf(uuid) + if (index > -1){ + queue.splice(index, 1) + $(`#download_${queueList[uuid].uuid}`).remove() + delete queueList[uuid] + } +}) + socket.on("startDownload", function(uuid){ $('#bar_' + uuid).removeClass('indeterminate').addClass('determinate') })