diff --git a/src/main/resources/static/js/music.js b/src/main/resources/static/js/music.js index ecae06a..68af8d0 100644 --- a/src/main/resources/static/js/music.js +++ b/src/main/resources/static/js/music.js @@ -245,6 +245,7 @@ function getPlayList() { modal_loading.close(); loadingFlag = false; } + $(".ctl-btn").removeClass("disabled"); }).fail(function (data) { @@ -343,12 +344,13 @@ function updateControl(data) { updateModal(data); } -function sendCommand(command, stopRefresh) { - if(stopRefresh){ - clearInterval(interval); +function sendCommand(command, modal) { + clearInterval(interval); + if(modal){ modal_loading.open(); } + $(".ctl-btn").addClass("disabled"); $.ajax({ type: "POST", @@ -358,8 +360,8 @@ function sendCommand(command, stopRefresh) { data: JSON.stringify(command), success: function (data) { loadingFlag = true; - if(stopRefresh) - interval = setInterval("getCurentMusic()", 1000); + interval = setInterval("getCurentMusic()", 1000); + if(command.command === "ADD"){ M.toast({ html: " check_circle Video added to playlist!", @@ -368,6 +370,7 @@ function sendCommand(command, stopRefresh) { }); } + } }).fail(function (data) { @@ -385,6 +388,7 @@ function sendCommand(command, stopRefresh) { displayLength: 99999999 }); } + $(".ctl-btn").removeClass("disabled"); }); } diff --git a/src/main/resources/templates/music.html b/src/main/resources/templates/music.html index 8cd26c3..aed3984 100644 --- a/src/main/resources/templates/music.html +++ b/src/main/resources/templates/music.html @@ -73,17 +73,17 @@
- + stop
- + play_arrow
- + skip_next
@@ -100,7 +100,7 @@
- + call_end
@@ -115,7 +115,7 @@
Playlist
@@ -127,7 +127,7 @@
AutoFlow
-
+
- -