mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Fixed scaling issue on mobile when playing, and fixed embed crashes
This commit is contained in:
@@ -148,6 +148,8 @@ window.addEventListener("load", function() {
|
||||
}
|
||||
});
|
||||
|
||||
function resizePlaylistPlaying(){};
|
||||
|
||||
function startWaitTimerPlay() {
|
||||
setTimeout(function() {
|
||||
if(videoSource == "youtube") {
|
||||
|
||||
@@ -47,7 +47,7 @@ function resizeFunction() {
|
||||
}
|
||||
var temp_fit;
|
||||
|
||||
if(!Helper.mobilecheck() && !embed && !client){
|
||||
if(!embed && !client){
|
||||
temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71);
|
||||
List.element_height = (Helper.computedStyle("#wrapper", "height") / temp_fit)-5.3;
|
||||
} else if(embed) {
|
||||
@@ -835,29 +835,29 @@ function change_offline(enabled, already_offline){
|
||||
List.sortList();
|
||||
List.populate_list(full_playlist);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
/*if(list_html == undefined){
|
||||
var tempOuter = document.createElement("div");
|
||||
list_html.innerHTML = list_html;
|
||||
//list_html.find(".list-remove").removeClass("hide");
|
||||
list_html = list_html.innerHTML;
|
||||
}*/
|
||||
if(!Admin.logged_in) Helper.addClass(".delete-context-menu", "context-menu-disabled");
|
||||
Helper.removeClass(".margin-playbar", "margin-playbar");
|
||||
Helper.addClass("#playpause", "margin-playbar");
|
||||
Helper.removeClass("#viewers", "hide");
|
||||
Helper.addClass(".prev playbar", "hide");
|
||||
Helper.addClass("#offline-mode", "waves-cyan");
|
||||
Helper.removeClass("#offline-mode", "cyan");
|
||||
if(!Helper.mobilecheck()) {
|
||||
}*/
|
||||
if(!Admin.logged_in) Helper.addClass(".delete-context-menu", "context-menu-disabled");
|
||||
Helper.removeClass(".margin-playbar", "margin-playbar");
|
||||
Helper.addClass("#playpause", "margin-playbar");
|
||||
Helper.removeClass("#viewers", "hide");
|
||||
Helper.addClass(".prev playbar", "hide");
|
||||
Helper.addClass("#offline-mode", "waves-cyan");
|
||||
Helper.removeClass("#offline-mode", "cyan");
|
||||
if(!Helper.mobilecheck()) {
|
||||
Helper.tooltip("#offline-mode", {
|
||||
delay: 5,
|
||||
position: "bottom",
|
||||
html: "Enable local mode"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if(window.location.pathname != "/"){
|
||||
if(window.location.pathname != "/"){
|
||||
document.getElementById("controls").removeEventListener("mouseenter", mouseEnter, false);
|
||||
document.getElementById("controls").removeEventListener("mouseleave", mouseLeave, false);
|
||||
document.getElementById("controls").removeEventListener("mousedown", mouseDown, false);
|
||||
@@ -871,12 +871,12 @@ function change_offline(enabled, already_offline){
|
||||
//if(private_channel) add = Crypt.getCookie("_uI") + "_";
|
||||
socket.emit("list", {version: parseInt(localStorage.getItem("VERSION")), channel: add + chan.toLowerCase()});
|
||||
Helper.removeClass("#controls", "ewresize");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resizePlaylistPlaying(playing) {
|
||||
if(document.querySelector("#wrapper") == null) return;
|
||||
if(document.querySelector("#wrapper") == null || embed || client) return;
|
||||
if(window.innerWidth < 601) {
|
||||
var subtract = 0;
|
||||
if(playing) {
|
||||
@@ -896,15 +896,9 @@ function resizePlaylistPlaying(playing) {
|
||||
var canFit = List.can_fit;
|
||||
Helper.css("#wrapper", "height", window.innerHeight - 246 - subtract + "px");
|
||||
|
||||
if(!Helper.mobilecheck() && !embed && !client){
|
||||
if(!embed && !client){
|
||||
temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71);
|
||||
List.element_height = (Helper.computedStyle("#wrapper", "height") / temp_fit)-5.3;
|
||||
} else if(embed) {
|
||||
temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 91) + 1;
|
||||
List.element_height = (Helper.computedStyle("#wrapper", "height") / temp_fit)-4;
|
||||
} else if(!client){
|
||||
temp_fit = Math.round((Helper.computedStyle(".tabs", "height") - Helper.computedStyle("header", "height") - 64 - 40) / 71)+1;
|
||||
List.element_height = ((window.innerHeight - Helper.computedStyle(".tabs", "height") - Helper.computedStyle("header", "height") - 64 - 40) / temp_fit)-5;
|
||||
} else {
|
||||
temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1;
|
||||
List.element_height = (Helper.computedStyle("#wrapper", "height") / temp_fit)-5.3;
|
||||
@@ -1181,22 +1175,22 @@ function before_toast(){
|
||||
var toastElement = $('.toast').first()[0];
|
||||
var toastInstance = toastElement.M_Toast;
|
||||
toastInstance.remove();
|
||||
}*/
|
||||
/*var toasts = document.querySelector(".toast");
|
||||
//for(var i = 0; i < toasts.length; i++) {
|
||||
// var instance = M.Toast.getInstance(toasts[i]);
|
||||
if(toasts == null) return;
|
||||
var instance = M.Toast.getInstance(toasts);
|
||||
try {
|
||||
console.log(instance);
|
||||
if(instance.timeRemaining > 0) {
|
||||
instance.dismiss();
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
//}*/
|
||||
M.Toast.dismissAll();
|
||||
//Materialize.Toast.removeAll();
|
||||
}*/
|
||||
/*var toasts = document.querySelector(".toast");
|
||||
//for(var i = 0; i < toasts.length; i++) {
|
||||
// var instance = M.Toast.getInstance(toasts[i]);
|
||||
if(toasts == null) return;
|
||||
var instance = M.Toast.getInstance(toasts);
|
||||
try {
|
||||
console.log(instance);
|
||||
if(instance.timeRemaining > 0) {
|
||||
instance.dismiss();
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
//}*/
|
||||
M.Toast.dismissAll();
|
||||
//Materialize.Toast.removeAll();
|
||||
}
|
||||
|
||||
function scrollChat() {
|
||||
@@ -1223,15 +1217,15 @@ function searchTimeout(event) {
|
||||
if(search_input.length == 0) {
|
||||
document.querySelector("body").setAttribute("style", "overflow-y: auto");
|
||||
}
|
||||
}*/
|
||||
if(code == 13){
|
||||
}*/
|
||||
if(code == 13){
|
||||
Search.search(search_input);
|
||||
Search.soundcloudSearch(search_input);
|
||||
}else{
|
||||
}else{
|
||||
timeout_search = setTimeout(function(){
|
||||
Search.search(search_input);
|
||||
Search.soundcloudSearch(search_input);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user