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
1 changed files with 43 additions and 30 deletions

View File

@ -1575,28 +1575,7 @@ function pingMessage(isHighlight) {
/* layouts */
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")) {
function undoHDLayout() {
$("body").removeClass("hd");
$("#drinkbar").detach().removeClass().addClass("col-lg-12 col-md-12")
.appendTo("#drinkbarwrap");
@ -1627,6 +1606,31 @@ function compactLayout() {
$("#mainpage").css("padding-top", "60px");
$("#queue").css("max-height", "500px");
$("#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");
@ -1634,6 +1638,9 @@ function compactLayout() {
}
function fluidLayout() {
if ($("body").hasClass("hd")) {
undoHDLayout();
}
$(".container").removeClass("container").addClass("container-fluid");
$("footer .container-fluid").removeClass("container-fluid").addClass("container");
$("body").addClass("fluid");
@ -1641,6 +1648,9 @@ function fluidLayout() {
}
function synchtubeLayout() {
if ($("body").hasClass("hd")) {
undoHDLayout();
}
if($("#userlisttoggle").hasClass("glyphicon-chevron-right")){
$("#userlisttoggle").removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-left")
}
@ -1652,6 +1662,9 @@ function synchtubeLayout() {
$("body").addClass("synchtube");
}
/*
* "HD" is kind of a misnomer. Should be renamed at some point.
*/
function hdLayout() {
var videowrap = $("#videowrap"),
chatwrap = $("#chatwrap"),