Leaving fixes

This commit is contained in:
Kasper Rynning-Tønnesen
2016-05-09 15:45:56 +02:00
parent 8f1499dacd
commit 3a5efd9009
3 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -219,7 +219,7 @@ var Nochan = {
} }
}, },
to_channel: function(chan, popstate){ to_channel: function(new_channel, popstate){
$("#channel-load").css("display", "block"); $("#channel-load").css("display", "block");
window.scrollTo(0, 0); window.scrollTo(0, 0);
@@ -227,20 +227,20 @@ var Nochan = {
if(window.mobilecheck()) socket.removeAllListeners(); if(window.mobilecheck()) socket.removeAllListeners();
$("body").css("background-color", "#2d2d2d"); $("body").css("background-color", "#2d2d2d");
$.ajax({ $.ajax({
url: chan + "/php/index.php", url: new_channel + "/php/index.php",
success: function(e){ success: function(e){
if(Player.ytplayer != ""){ if(Player.ytplayer != ""){
Player.ytplayer.destroy(); Player.ytplayer.destroy();
socket.emit("change_channel"); socket.emit("change_channel", {channel: chan.toLowerCase()});
} }
$("#frontpage_player").empty(); $("#frontpage_player").empty();
if(window.mobilecheck()) socket.disconnect(); if(window.mobilecheck()) socket.disconnect();
if(!popstate){ if(!popstate){
window.history.pushState("to the channel!", "Title", "/" + chan); window.history.pushState("to the channel!", "Title", "/" + new_channel);
window.chan = chan; window.chan = new_channel;
} }
$(".mega").remove(); $(".mega").remove();