Fix fluid layout

This commit is contained in:
calzoneman 2014-01-25 21:48:57 -06:00
parent 574ef4435c
commit bedf3afb61
2 changed files with 18 additions and 1 deletions

View file

@ -43,6 +43,7 @@ var YouTubePlayer = function (data) {
},
events: {
onReady: function () {
resizeStuff();
},
onStateChange: function (ev) {
if(PLAYER.paused && ev.data != YT.PlayerState.PAUSED ||

View file

@ -1355,7 +1355,7 @@ function addChatMessage(data) {
function fluidLayout() {
$(".container").removeClass("container").addClass("container-fluid");
// TODO resize
resizeStuff();
}
function synchtubeLayout() {
@ -1375,6 +1375,22 @@ function chatOnly() {
$("#chatwrap").removeClass("col-lg-5 col-md-5").addClass("col-lg-12 col-md-12");
}
function resizeStuff() {
// Only execute if we are on a fluid layout
if ($(".container-fluid").length === 0) {
return;
}
VWIDTH = $("#videowrap").width() + "";
VHEIGHT = Math.floor(parseInt(VWIDTH) * 9 / 16) + "";
$("#ytapiplayer").width(VWIDTH).height(VHEIGHT);
var h = parseInt(VHEIGHT) - 33;
$("#messagebuffer").height(h);
$("#userlist").height(h);
}
$(window).resize(resizeStuff);
/* channel administration stuff */
function genPermissionsEditor() {