diff --git a/public/css/style.css b/public/css/style.css index 1631c86..aef1d90 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -260,10 +260,12 @@ div#download_tab{ } #download_list > .download_object .download_info_data{ width: 100%; - padding-left: 8px; + margin-left: 8px; } #download_list > .download_object .download_info_status{ + margin-left: 8px; width: 80px; + text-align: right; } #download_list.slim > .download_object .download_info img{ display: none; @@ -275,12 +277,12 @@ div#download_tab{ display: inline-block; } #download_list.slim > .download_object .download_info_data{ - width: auto; + width: calc(80% - 8px); display: inline-block; padding-left: 0px; } #download_list.slim > .download_object .download_info_status{ - width: auto; + width: 20%; display: inline-block; float: right; } @@ -288,6 +290,10 @@ div#download_tab{ display: block; } +.download_object > .download_bar > .queue_icon{ + margin-left: 8px; +} + .download_object > .download_bar{ display: flex; align-items: center; diff --git a/public/js/downloadList.js b/public/js/downloadList.js index 6d66f52..8b301ee 100644 --- a/public/js/downloadList.js +++ b/public/js/downloadList.js @@ -58,23 +58,25 @@ socket.on("startDownload", function(uuid){ }) socket.on("finishDownload", function(uuid){ - toast(`${queueList[uuid].title} finished downloading.`, 'done') - $('#bar_' + uuid).css('width', '100%') - let result_icon = $('#download_'+uuid).find('.queue_icon') - if (queueList[uuid].failed == 0){ - result_icon.text("done") - }else if (queueList[uuid].failed >= queueList[uuid].size){ - result_icon.text("error") - }else{ - result_icon.text("warning") - } - let index = queue.indexOf(uuid) - if (index > -1){ - queue.splice(index, 1) - delete queueList[uuid] - } - if (queue.length <= 0){ - toast('All downloads completed!', 'all_done') + if (queue.indexOf(uuid) > -1){ + toast(`${queueList[uuid].title} finished downloading.`, 'done') + $('#bar_' + uuid).css('width', '100%') + let result_icon = $('#download_'+uuid).find('.queue_icon') + if (queueList[uuid].failed == 0){ + result_icon.text("done") + }else if (queueList[uuid].failed >= queueList[uuid].size){ + result_icon.text("error") + }else{ + result_icon.text("warning") + } + let index = queue.indexOf(uuid) + if (index > -1){ + queue.splice(index, 1) + delete queueList[uuid] + } + if (queue.length <= 0){ + toast('All downloads completed!', 'all_done') + } } })