CC-3496 : PlaylistBuilder, NowPlaying -> GUI representation gets broken while being resized

This commit is contained in:
Naomi Aro 2012-03-30 17:13:17 +02:00
parent 2ab6ea98a6
commit 5242ac45a9
1 changed files with 15 additions and 10 deletions

View File

@ -4,6 +4,7 @@ AIRTIME = (function(AIRTIME) {
$lib, $lib,
$libWrapper, $libWrapper,
$builder, $builder,
$fs,
widgetHeight, widgetHeight,
screenWidth, screenWidth,
oBaseDatePickerSettings, oBaseDatePickerSettings,
@ -40,7 +41,7 @@ AIRTIME = (function(AIRTIME) {
defaultTime: '0:00' defaultTime: '0:00'
}; };
function setWidgetHeights() { function setWidgetSize() {
viewport = AIRTIME.utilities.findViewportDimensions(); viewport = AIRTIME.utilities.findViewportDimensions();
widgetHeight = viewport.height - 180; widgetHeight = viewport.height - 180;
screenWidth = Math.floor(viewport.width - 120); screenWidth = Math.floor(viewport.width - 120);
@ -48,6 +49,10 @@ AIRTIME = (function(AIRTIME) {
var libTableHeight = widgetHeight - 130, var libTableHeight = widgetHeight - 130,
builderTableHeight = widgetHeight - 95; builderTableHeight = widgetHeight - 95;
if ($fs.is(':visible')) {
builderTableHeight = builderTableHeight - 40;
}
//set the heights of the main widgets. //set the heights of the main widgets.
$builder.height(widgetHeight) $builder.height(widgetHeight)
.find(".dataTables_scrolling") .find(".dataTables_scrolling")
@ -55,13 +60,14 @@ AIRTIME = (function(AIRTIME) {
.end() .end()
.width(screenWidth); .width(screenWidth);
$lib.height(widgetHeight)
.find(".dataTables_scrolling")
.css("max-height", libTableHeight)
.end();
if ($lib.filter(':visible').length > 0) { if ($lib.filter(':visible').length > 0) {
$lib.width(Math.floor(screenWidth * 0.5)) $lib.width(Math.floor(screenWidth * 0.5));
.height(widgetHeight)
.find(".dataTables_scrolling")
.css("max-height", libTableHeight)
.end();
$builder.width(Math.floor(screenWidth * 0.5)) $builder.width(Math.floor(screenWidth * 0.5))
.find("#sb_edit") .find("#sb_edit")
@ -74,6 +80,7 @@ AIRTIME = (function(AIRTIME) {
//define module vars. //define module vars.
$lib = $("#library_content"); $lib = $("#library_content");
$builder = $("#show_builder"); $builder = $("#show_builder");
$fs = $builder.find('fieldset');
$builder.find(dateStartId).datepicker(oBaseDatePickerSettings); $builder.find(dateStartId).datepicker(oBaseDatePickerSettings);
$builder.find(timeStartId).timepicker(oBaseTimePickerSettings); $builder.find(timeStartId).timepicker(oBaseTimePickerSettings);
@ -84,7 +91,7 @@ AIRTIME = (function(AIRTIME) {
AIRTIME.showbuilder.fnServerData.start = oRange.start; AIRTIME.showbuilder.fnServerData.start = oRange.start;
AIRTIME.showbuilder.fnServerData.end = oRange.end; AIRTIME.showbuilder.fnServerData.end = oRange.end;
setWidgetHeights(); setWidgetSize();
AIRTIME.library.libraryInit(); AIRTIME.library.libraryInit();
AIRTIME.showbuilder.builderDataTable(); AIRTIME.showbuilder.builderDataTable();
@ -168,8 +175,6 @@ AIRTIME = (function(AIRTIME) {
$builder.find('legend').click(function(ev, item){ $builder.find('legend').click(function(ev, item){
var $fs = $(this).parents('fieldset');
if ($fs.hasClass("closed")) { if ($fs.hasClass("closed")) {
$fs.removeClass("closed"); $fs.removeClass("closed");
@ -235,7 +240,7 @@ AIRTIME = (function(AIRTIME) {
}; };
mod.onResize = function() { mod.onResize = function() {
setWidgetHeights(); setWidgetSize();
}; };
return AIRTIME; return AIRTIME;