mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed issue with volumeslider being messed up on windowresize
This commit is contained in:
@@ -11,6 +11,7 @@ var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*
|
||||
var conf = [];
|
||||
var private_channel = false;
|
||||
var music = 0;
|
||||
var slider_type = "horizontal";
|
||||
var gotten_np = false;
|
||||
var frontpage = 1;
|
||||
var empty_clear = false;
|
||||
@@ -335,17 +336,6 @@ function init(){
|
||||
tooltip: "Search"
|
||||
});
|
||||
|
||||
/*$("#prev").tooltip({
|
||||
delay: 5,
|
||||
position: "bottom",
|
||||
tooltip: "Previous",
|
||||
});
|
||||
|
||||
$("#skip").tooltip({
|
||||
delay: 5,
|
||||
position: "bottom",
|
||||
tooltip: "Skip",
|
||||
});*/
|
||||
|
||||
$("#shuffle").tooltip({
|
||||
delay: 5,
|
||||
@@ -368,6 +358,7 @@ if(Helper.mobilecheck()) {
|
||||
Mobile_remote.initiate_volume();
|
||||
} else {
|
||||
$('input#chan_description').characterCounter();
|
||||
window_width_volume_slider();
|
||||
}
|
||||
|
||||
setup_admin_listener();
|
||||
@@ -1689,8 +1680,20 @@ $(window).resize(function(){
|
||||
set_title_width();
|
||||
if($("#controls").length > 0 && !Helper.mobilecheck()) $("#seekToDuration").css("top", $("#controls").position().top - 55);
|
||||
else if($("#controls").length > 0) $("#seekToDuration").css("top", $("#controls").position().top - 20);
|
||||
|
||||
window_width_volume_slider();
|
||||
}
|
||||
});
|
||||
|
||||
function window_width_volume_slider() {
|
||||
if(window.innerWidth <= 600 && slider_type == "horizontal") {
|
||||
Playercontrols.initSlider(true);
|
||||
slider_type = "vertical";
|
||||
} else if(window.innerWidth > 600 && slider_type == "vertical") {
|
||||
Playercontrols.initSlider();
|
||||
slider_type = "horizontal";
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on( "click", ".result-object", function(e){
|
||||
var $html = $(e.target);
|
||||
|
||||
@@ -17,9 +17,10 @@ var Playercontrols = {
|
||||
$("#fullscreen").on("click", Playercontrols.fullscreen);
|
||||
},
|
||||
|
||||
initSlider: function() {
|
||||
initSlider: function(vertical) {
|
||||
try {
|
||||
vol = (Crypt.get_volume());
|
||||
$("#volume").slider( "destroy" );
|
||||
} catch(e){}
|
||||
var slider_values = {
|
||||
min: 0,
|
||||
@@ -28,12 +29,11 @@ var Playercontrols = {
|
||||
range: "min",
|
||||
animate: true,
|
||||
slide: function(event, ui) {
|
||||
|
||||
Playercontrols.setVolume(ui.value);
|
||||
try{Crypt.set_volume(ui.value);}catch(e){}
|
||||
}
|
||||
};
|
||||
if(Helper.mobilecheck()) {
|
||||
if(Helper.mobilecheck() || vertical) {
|
||||
slider_values.orientation = "vertical";
|
||||
$(".volume-container").toggleClass("hide");
|
||||
}
|
||||
@@ -109,7 +109,7 @@ var Playercontrols = {
|
||||
},
|
||||
|
||||
mute_video: function() {
|
||||
if(Helper.mobilecheck()) {
|
||||
if(Helper.mobilecheck() || slider_type == "vertical") {
|
||||
$(".volume-container").toggleClass("hide");
|
||||
} else {
|
||||
if(!Player.player.isMuted()) {
|
||||
|
||||
Reference in New Issue
Block a user