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

View File

@@ -19,8 +19,8 @@
<a href="/" class="brand-logo brand-logo-navigate hide-on-med-and-down noselect"> <a href="/" class="brand-logo brand-logo-navigate hide-on-med-and-down noselect">
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff" /> <img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff" />
</a> </a>
<div class="brand-logo brand-logo-navigate truncate zbrand"> <div class="brand-logo truncate zbrand">
<a href="/" class="hide-on-large-only">Zöff</a> <a href="/" class="hide-on-large-only brand-logo-navigate">Zöff</a>
<span class="hide-on-large-only">/</span> <span class="hide-on-large-only">/</span>
<span id="chan" class="chan clickable" title="Show big URL"><?php echo(ucfirst($list));?></span> <span id="chan" class="chan clickable" title="Show big URL"><?php echo(ucfirst($list));?></span>
</div> </div>

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(){ function init(){
window.onpopstate = function(e){
onepage_load();
}
chan = $("#chan").html(); chan = $("#chan").html();
if(window.location.hostname == "zoff.no") add = "https://zoff.no"; if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = "localhost"; else add = "localhost";
@@ -389,9 +394,6 @@ $(document).on("click", ".brand-logo-navigate", function(e){
onepage_load(); onepage_load();
}); });
window.onpopstate = function(e){
onepage_load();
}
function 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() { String.prototype.capitalizeFirstLetter = function() {
return this.charAt(0).toUpperCase() + this.slice(1); return this.charAt(0).toUpperCase() + this.slice(1);
} }
@@ -273,6 +263,16 @@ String.prototype.capitalizeFirstLetter = function() {
$().ready(initfp); $().ready(initfp);
function 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(); channel_list = $("#channel-list-container").html();
var connection_options = { var connection_options = {