summaryrefslogtreecommitdiff
path: root/app/ui/queue.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/ui/queue.php')
-rw-r--r--app/ui/queue.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/ui/queue.php b/app/ui/queue.php
index 81a7079..7d38625 100644
--- a/app/ui/queue.php
+++ b/app/ui/queue.php
@@ -25,7 +25,10 @@
<script src="/assets/js/common.js"></script>
<div class="container">
<br>
- <h2 class="desktop-title" style="margin-top: 10px; margin-bottom: 20px; margin-left: 10px;">Queue</h2>
+ <h2 class="desktop-title" style="margin-top: 10px; margin-bottom: 20px; margin-left: 10px;">
+ Queue
+ <span class="btn btn-primary" style="float: right;" onclick="clearQueue();">Clear queue</span>
+ </h2>
<div class="list-group" style="margin-left: 10px; margin-top: 20px;" id="main-list"></div>
<div class="text-muted" style="margin-left: 10px; margin-top: 20px; display: none;" id="empty">
There are no songs playing next. To add songs to the queue, browse your library and select Add to queue.
@@ -33,6 +36,11 @@
</div>
<script>
+ function clearQueue() {
+ window.parent.playlist = window.parent.playlist.slice(0, window.parent.currentPlaylistPosition + 1);
+ refreshQueue();
+ }
+
function refreshQueue() {
let list = window.parent.playlist.slice(window.parent.currentPlaylistPosition + 1);
@@ -68,6 +76,7 @@
function removeSong(index) {
window.parent.playlist.splice(index, 1);
refreshQueue();
+ window.parent.updateDisplay(true);
}
refreshQueue();