Fix fluid layout
This commit is contained in:
parent
574ef4435c
commit
bedf3afb61
|
@ -43,6 +43,7 @@ var YouTubePlayer = function (data) {
|
|||
},
|
||||
events: {
|
||||
onReady: function () {
|
||||
resizeStuff();
|
||||
},
|
||||
onStateChange: function (ev) {
|
||||
if(PLAYER.paused && ev.data != YT.PlayerState.PAUSED ||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue