Fixed error with showing channel-url and popstatelistener not being updated to the current view

This commit is contained in:
Kasper Rynning-Tønnesen
2016-02-08 13:00:49 +01:00
parent 17dacc460a
commit 50bba53145
5 changed files with 19 additions and 17 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

@@ -54,6 +54,11 @@ $().ready(function(){init();});
function init(){
window.onpopstate = function(e){
onepage_load();
}
chan = $("#chan").html();
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = "localhost";
@@ -389,9 +394,6 @@ $(document).on("click", ".brand-logo-navigate", function(e){
onepage_load();
});
window.onpopstate = function(e){
onepage_load();
}
function onepage_load(){

View File

@@ -256,16 +256,6 @@ var Nochan = {
}
window.onpopstate = function(e){
var url_split = window.location.href.split("/");
if(url_split[3] != "" && url_split[3].substring(0,1) != "#"){
Nochan.to_channel(url_split[3], true);
}
}
String.prototype.capitalizeFirstLetter = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
}
@@ -273,6 +263,16 @@ String.prototype.capitalizeFirstLetter = function() {
$().ready(initfp);
function initfp(){
window.onpopstate = function(e){
var url_split = window.location.href.split("/");
if(url_split[3] != "" && url_split[3].substring(0,1) != "#"){
Nochan.to_channel(url_split[3], true);
}
}
channel_list = $("#channel-list-container").html();
var connection_options = {