diff --git a/php/src/public/js/app.js b/php/src/public/js/app.js index 6ccc3bc..be2d3ec 100644 --- a/php/src/public/js/app.js +++ b/php/src/public/js/app.js @@ -1,4 +1,5 @@ const appModal = $('#modalDownloadQueue'); +const loader = $("#loader-wrapper"); function proc_notification(icon, title, text) { Swal.fire({ @@ -8,12 +9,11 @@ function proc_notification(icon, title, text) { }) } -$('.settings_btn').on('click', () => { +$('#settings_btn').on('click', () => { $('#modalSettings').modal('toggle'); }) -$('.queue_btn').on('click', () => { - console.log('Get Queue!'); +$('#queue_btn').on('click', () => { appModal.modal('toggle'); }) @@ -29,18 +29,17 @@ $('#download_btn').on('click', () => { $("#loader-wrapper").fadeIn(300); $.ajax({ url: `/api/v1/get/artist/${artist}`, + async: false, }).done(function (res) { text = res.message; if (res.status === 200) { icon = 'success'; title = 'Shazam!'; } - $("#loader-wrapper").fadeOut(700); - proc_notification(icon, title, text); }); - } else { - proc_notification(icon, title, text); } + loader().fadeOut(700); + proc_notification(icon, title, text); }) document.addEventListener('alpine:init', () => { @@ -48,13 +47,14 @@ document.addEventListener('alpine:init', () => { Alpine.store('app', { init() { this.Artists = []; + this.Queue = []; }, Artists: [], Queue: false, }); - + $("#loader-wrapper").fadeOut(900); }) diff --git a/php/src/resources/views/components/action-menu.blade.php b/php/src/resources/views/components/action-menu.blade.php index 5cfe79a..df0d570 100644 --- a/php/src/resources/views/components/action-menu.blade.php +++ b/php/src/resources/views/components/action-menu.blade.php @@ -1,10 +1,12 @@
Downloading...
@@ -44,7 +47,9 @@Queue is empty
diff --git a/php/src/resources/views/layouts/public.blade.php b/php/src/resources/views/layouts/public.blade.php index 973fcbb..1a8f739 100644 --- a/php/src/resources/views/layouts/public.blade.php +++ b/php/src/resources/views/layouts/public.blade.php @@ -20,7 +20,7 @@ - +