mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Scrolling to top when changing document
This commit is contained in:
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
@@ -365,6 +365,8 @@ window.onpopstate = function(e){
|
|||||||
|
|
||||||
function onepage_load(){
|
function onepage_load(){
|
||||||
$("#channel-load").css("display", "block");
|
$("#channel-load").css("display", "block");
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
|
||||||
var url_split = window.location.href.split("/");
|
var url_split = window.location.href.split("/");
|
||||||
if(url_split[3] == "" || url_split[3].substring(0,1) == "#"){
|
if(url_split[3] == "" || url_split[3].substring(0,1) == "#"){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@@ -202,7 +202,8 @@ var Nochan = {
|
|||||||
to_channel: function(chan, popstate){
|
to_channel: function(chan, popstate){
|
||||||
|
|
||||||
$("#channel-load").css("display", "block");
|
$("#channel-load").css("display", "block");
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: chan + "/php/channel.php",
|
url: chan + "/php/channel.php",
|
||||||
success: function(e){
|
success: function(e){
|
||||||
@@ -325,6 +326,7 @@ $(document).on('click', '#toast-container', function(){
|
|||||||
|
|
||||||
$(document).on('click', ".chan-link", function(e){
|
$(document).on('click', ".chan-link", function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
Nochan.to_channel($(this).attr("href"), false);
|
Nochan.to_channel($(this).attr("href"), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -333,6 +335,7 @@ $(".listen-button").click(function(e){
|
|||||||
if($(".room-namer").val() == ""){
|
if($(".room-namer").val() == ""){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
//window.location = "?chan="+
|
//window.location = "?chan="+
|
||||||
|
|
||||||
Nochan.to_channel($(".room-namer").attr("placeholder"));
|
Nochan.to_channel($(".room-namer").attr("placeholder"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user