From 83925c2705dfef5d0e4bd5df0b6a3310d9d50f47 Mon Sep 17 00:00:00 2001 From: Junior Date: Sat, 1 Jun 2024 12:42:43 -0400 Subject: [PATCH] Remove async calls (and the need for them in the first place) --- js/minimal.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/js/minimal.js b/js/minimal.js index 3d3f0cf..e913ad3 100755 --- a/js/minimal.js +++ b/js/minimal.js @@ -15,12 +15,6 @@ $(document).ready(function() { } }); getVolumeRange(); - $('#volume_slider').slider({ animate: "fast", max: maxVolume, min: minVolume, step: 2 }); - $('#volume_slider').slider({ - change: function(event, ui) { if ( !volFromServer ) { setVolume(); } volFromServer = false; } - }); - $('#max_btn').click(function() { setSliderVolume(maxVolume); }); - $('#min_btn').click(function() { setSliderVolume(minVolume); }); //$('#skipsong_btn').click(function() { skipSong($(this)); }); //$('#skipsong_playing_btn').click(function() { skipSong($(this)); }); $('.skipsong_btn').click(function() { skipSong($(this)); }); @@ -313,11 +307,16 @@ function dropJukeboxSong(id) { function getVolumeRange() { $.ajax({ url: 'ajax/ajax_getvolrange.php', - async: false, dataType: 'json', success: function(data, stat, jqo) { maxVolume = data.max; minVolume = data.min; + $('#volume_slider').slider({ animate: "fast", max: maxVolume, min: minVolume, step: 2 }); + $('#volume_slider').slider({ + change: function(event, ui) { if ( !volFromServer ) { setVolume(); } volFromServer = false; } + }); + $('#max_btn').click(function() { setSliderVolume(maxVolume); }); + $('#min_btn').click(function() { setSliderVolume(minVolume); }); } }); } @@ -358,7 +357,6 @@ function skipSong (callingElement) { callingElement.addClass("buttonactive"); $.ajax({ url: 'ajax/ajax_skipsong.php', - async: false, success: function (data, stat, jqo) { callingElement.removeClass("buttonactive"); getSongList(); @@ -391,7 +389,6 @@ function dropSong (callingElement) { callingElement.addClass("buttonactive"); $.ajax({ url: 'ajax/ajax_dropsong.php', - async: false, success: function (data, stat, jqo) { callingElement.removeClass("buttonactive"); getSongList(); @@ -407,7 +404,6 @@ function changeQueue () { $.ajax({ url: 'ajax/ajax_changequeue.php', data: {newid: qid}, - async: false, success: function (data, stat, jqo) { getSongList(); }