diff --git a/server/public/assets/js/functions.js b/server/public/assets/js/functions.js index c9e2ccf3..5db9d648 100644 --- a/server/public/assets/js/functions.js +++ b/server/public/assets/js/functions.js @@ -21,6 +21,13 @@ function removeAllListeners() { socket.removeEventListener(id); } +function say_updated() { + setTimeout(function() { + before_toast(); + M.toast({html: "The list was updated, want to refresh? yesno", displayLength: 10000000}); + }, 500); +} + function sendDescription() { emit("suggest_description", {channel: chan, description: document.getElementById("description_input").value}); document.getElementById("description_input").value = ""; diff --git a/server/public/assets/js/list.js b/server/public/assets/js/list.js index 5f44851e..8a892bfb 100755 --- a/server/public/assets/js/list.js +++ b/server/public/assets/js/list.js @@ -406,6 +406,9 @@ var List = { type: "add", element: added, }); + if(Helper.mobilecheck()) { + say_updated(); + } } else { List.insertAtIndex(added, true); Helper.css(document.querySelector("#wrapper").children[List.page + List.can_fit], "display", "none"); @@ -432,6 +435,9 @@ var List = { element: full_playlist[index], index: index, }); + if(Helper.mobilecheck()) { + say_updated(); + } if(index != -1) full_playlist.splice(index, 1); var this_element = document.getElementById(deleted); Helper.addClass(this_element, "disabled-vote"); @@ -547,6 +553,9 @@ var List = { element: song_voted_on }); List.sortList(); + if(Helper.mobilecheck()) { + say_updated(); + } } else { List.sortList(); Helper.removeElement("#"+voted); diff --git a/server/public/assets/js/listeners.js b/server/public/assets/js/listeners.js index fc45c9cf..46208eed 100755 --- a/server/public/assets/js/listeners.js +++ b/server/public/assets/js/listeners.js @@ -450,6 +450,19 @@ function addDynamicListeners() { } }); + if(Helper.mobilecheck()) { + addListener("click", "#refresh_mobile", function(event) { + this.preventDefault(); + clearIntelligentQueue(); + before_toast(); + }); + + addListener("click", "#dont_refresh_list", function(event) { + this.preventDefault(); + before_toast(); + }); + } + addListener("click", "#player_overlay", function(event) { if(chromecastAvailable) { Player.playPauseVideo(); diff --git a/server/public/partials/channel/client_settings.handlebars b/server/public/partials/channel/client_settings.handlebars index 15760670..36216679 100644 --- a/server/public/partials/channel/client_settings.handlebars +++ b/server/public/partials/channel/client_settings.handlebars @@ -4,7 +4,7 @@
When enabling intelligent playlist, playlist elements are not updated and moved around when the playlist is in focus. If things are jumping too much around in the playlist when voting, you should enable this.
{{#unless client}}