From d31c589b87c6887402640059d81483579d23b27b Mon Sep 17 00:00:00 2001 From: Junior Date: Sat, 18 Apr 2020 15:21:10 -0400 Subject: [PATCH] Make the drop song button not change to active color if the function was aborted --- ajax_dropsong.php | 3 ++- minimal.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 ajax_dropsong.php mode change 100644 => 100755 minimal.js diff --git a/ajax_dropsong.php b/ajax_dropsong.php old mode 100644 new mode 100755 index 8b8ff55..d798002 --- a/ajax_dropsong.php +++ b/ajax_dropsong.php @@ -15,7 +15,8 @@ if ( false !== ($row = $sth->fetch()) ) { exit(); } -$query = "DELETE FROM " . QUEUECONTENTSTABLE . " WHERE qid=(SELECT id FROM " . QUEUESTABLE . " WHERE active='true' AND type='user') AND songid=(SELECT songid FROM " . RECENTSTABLE . " ORDER BY timeplayed DESC LIMIT 1)"; +$query = "DELETE FROM " . QUEUECONTENTSTABLE . " WHERE qid=(SELECT id FROM " . QUEUESTABLE . " "; +$query .= "WHERE active='true' AND type='user') AND songid=(SELECT songid FROM " . RECENTSTABLE . " ORDER BY timeplayed DESC LIMIT 1)"; $sth = $globaldbh->prepare($query); $sth->execute(); diff --git a/minimal.js b/minimal.js old mode 100644 new mode 100755 index 230065d..aef05f8 --- a/minimal.js +++ b/minimal.js @@ -374,8 +374,8 @@ function emptyJukebox (callingElement) { function dropSong (callingElement) { callingElement.blur(); - callingElement.addClass("buttonactive"); if ( gettingJukeboxList || gettingSongList ) return false; + callingElement.addClass("buttonactive"); $.ajax({ url: 'ajax_dropsong.php', async: false,