From e2e45b01600318c8d96bd7e3b85b8fb91ed28f5e Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 14 Feb 2013 15:34:11 -0500 Subject: [PATCH] CC-4948: Library -> library loses have its width when window is resized -fixed --- airtime_mvc/public/js/airtime/library/spl.js | 34 ++++++++++++-------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 25203e631..534c5d5b7 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -1072,20 +1072,28 @@ var AIRTIME = (function(AIRTIME){ }; function setWidgetSize() { - viewport = AIRTIME.utilities.findViewportDimensions(); - widgetHeight = viewport.height - 185; - width = Math.floor(viewport.width - 80); - - var libTableHeight = widgetHeight - 130; + viewport = AIRTIME.utilities.findViewportDimensions(); + widgetHeight = viewport.height - 185; + width = Math.floor(viewport.width - 80); - $lib.height(widgetHeight) - .find(".dataTables_scrolling") - .css("max-height", libTableHeight) - .end() - .width(Math.floor(width * 0.55)); - - $pl.height(widgetHeight) - .width(Math.floor(width * 0.45)); + var libTableHeight = widgetHeight - 130; + + if (!$pl.is(':hidden')) { + $lib.height(widgetHeight) + .find(".dataTables_scrolling") + .css("max-height", libTableHeight) + .end() + .width(Math.floor(width * 0.55)); + + $pl.height(widgetHeight) + .width(Math.floor(width * 0.45)); + } else { + $lib.height(widgetHeight) + .find(".dataTables_scrolling") + .css("max-height", libTableHeight) + .end() + .width(width + 40); + } } mod.onReady = function() {