mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed where the playeroverlay doesn't show on channels without songs
This commit is contained in:
2
static/dist/embed.min.js
vendored
2
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.min.js
vendored
File diff suppressed because one or more lines are too long
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -172,6 +172,12 @@ var Helper = {
|
||||
return string.substring(0,1).toUpperCase()+string.substring(1).toLowerCase();
|
||||
},
|
||||
|
||||
addClass: function(object, toAdd){
|
||||
if(!Helper.contains($(object).attr("class").split(" "), toAdd)){
|
||||
$(object).addClass(toAdd);
|
||||
}
|
||||
},
|
||||
|
||||
send_mail: function(from, message){
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ var Youtube = {
|
||||
{
|
||||
Youtube.loaded = false;
|
||||
|
||||
if(obj[0].length == 0){
|
||||
if(obj.length == 0){
|
||||
|
||||
document.getElementById('song-title').innerHTML = "Empty channel. Add some songs!";
|
||||
$("#player_overlay").height($("#player").height());
|
||||
@@ -36,8 +36,6 @@ var Youtube = {
|
||||
seekTo = time - conf["startTime"];
|
||||
song_title = obj[0][0]["title"];
|
||||
|
||||
$("#player_overlay").addClass("hide");
|
||||
|
||||
try{
|
||||
Suggestions.fetchYoutubeSuggests(video_id);
|
||||
}catch(e){}
|
||||
@@ -64,6 +62,7 @@ var Youtube = {
|
||||
if(Youtube.ytplayer.getDuration() > seekTo || Youtube.ytplayer.getDuration() == 0)
|
||||
Youtube.ytplayer.seekTo(seekTo);
|
||||
Youtube.after_load = video_id;
|
||||
|
||||
setTimeout(function(){Youtube.loaded = true;},500);
|
||||
}catch(e){Youtube.durationSetter();}
|
||||
}
|
||||
@@ -98,6 +97,7 @@ var Youtube = {
|
||||
Youtube.ytplayer.pauseVideo();
|
||||
beginning = false;
|
||||
}
|
||||
Helper.addClass("#player_overlay", "hide");
|
||||
if(document.getElementById("play").className.split(" ").length == 1)
|
||||
$("#play").toggleClass("hide");
|
||||
if(document.getElementById("pause").className.split(" ").length == 2)
|
||||
|
||||
Reference in New Issue
Block a user