Undo HD layout before applying synchtube, fluid (#549)

This commit is contained in:
calzoneman 2016-01-03 22:53:29 -08:00
parent be4011cda1
commit 865a7453d9

View file

@ -1575,28 +1575,7 @@ function pingMessage(isHighlight) {
/* layouts */ /* layouts */
function compactLayout() { function undoHDLayout() {
/* Undo synchtube layout */
if ($("body").hasClass("synchtube")) {
$("body").removeClass("synchtube")
$("#chatwrap").detach().insertBefore($("#videowrap"));
$("#leftcontrols").detach().insertBefore($("#rightcontrols"));
$("#leftpane").detach().insertBefore($("#rightpane"));
$("#userlist").css("float", "left");
if($("#userlisttoggle").hasClass("glyphicon-chevron-left")){
$("#userlisttoggle").removeClass("glyphicon-chevron-left").addClass("glyphicon-chevron-right")
}
$("#userlisttoggle").removeClass("pull-right").addClass("pull-left")
}
/* Undo fluid layout */
if ($("body").hasClass("fluid")) {
$("body").removeClass("fluid")
$(".container-fluid").removeClass("container-fluid").addClass("container");
}
/* Undo HD layout */
if ($("body").hasClass("hd")) {
$("body").removeClass("hd"); $("body").removeClass("hd");
$("#drinkbar").detach().removeClass().addClass("col-lg-12 col-md-12") $("#drinkbar").detach().removeClass().addClass("col-lg-12 col-md-12")
.appendTo("#drinkbarwrap"); .appendTo("#drinkbarwrap");
@ -1629,11 +1608,39 @@ function compactLayout() {
$("#messagebuffer, #userlist").css("max-height", ""); $("#messagebuffer, #userlist").css("max-height", "");
} }
function compactLayout() {
/* Undo synchtube layout */
if ($("body").hasClass("synchtube")) {
$("body").removeClass("synchtube")
$("#chatwrap").detach().insertBefore($("#videowrap"));
$("#leftcontrols").detach().insertBefore($("#rightcontrols"));
$("#leftpane").detach().insertBefore($("#rightpane"));
$("#userlist").css("float", "left");
if($("#userlisttoggle").hasClass("glyphicon-chevron-left")){
$("#userlisttoggle").removeClass("glyphicon-chevron-left").addClass("glyphicon-chevron-right")
}
$("#userlisttoggle").removeClass("pull-right").addClass("pull-left")
}
/* Undo fluid layout */
if ($("body").hasClass("fluid")) {
$("body").removeClass("fluid")
$(".container-fluid").removeClass("container-fluid").addClass("container");
}
/* Undo HD layout */
if ($("body").hasClass("hd")) {
undoHDLayout();
}
$("body").addClass("compact"); $("body").addClass("compact");
handleVideoResize(); handleVideoResize();
} }
function fluidLayout() { function fluidLayout() {
if ($("body").hasClass("hd")) {
undoHDLayout();
}
$(".container").removeClass("container").addClass("container-fluid"); $(".container").removeClass("container").addClass("container-fluid");
$("footer .container-fluid").removeClass("container-fluid").addClass("container"); $("footer .container-fluid").removeClass("container-fluid").addClass("container");
$("body").addClass("fluid"); $("body").addClass("fluid");
@ -1641,6 +1648,9 @@ function fluidLayout() {
} }
function synchtubeLayout() { function synchtubeLayout() {
if ($("body").hasClass("hd")) {
undoHDLayout();
}
if($("#userlisttoggle").hasClass("glyphicon-chevron-right")){ if($("#userlisttoggle").hasClass("glyphicon-chevron-right")){
$("#userlisttoggle").removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-left") $("#userlisttoggle").removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-left")
} }
@ -1652,6 +1662,9 @@ function synchtubeLayout() {
$("body").addClass("synchtube"); $("body").addClass("synchtube");
} }
/*
* "HD" is kind of a misnomer. Should be renamed at some point.
*/
function hdLayout() { function hdLayout() {
var videowrap = $("#videowrap"), var videowrap = $("#videowrap"),
chatwrap = $("#chatwrap"), chatwrap = $("#chatwrap"),