diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index e9d813e0c..5ec73ac5d 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -391,7 +391,9 @@ var AIRTIME = (function(AIRTIME) { $libTable = $libContent.find("table"); - var tableHeight = $libContent.height() - 130; + function getTableHeight() { + return $libContent.height() - 175; + } function setColumnFilter(oTable){ // TODO : remove this dirty hack once js is refactored @@ -454,6 +456,13 @@ var AIRTIME = (function(AIRTIME) { } else { $el.hide(); } + + //resize to prevent double scroll bars. + var $fs = $el.parents("fieldset"), + tableHeight = getTableHeight(), + searchHeight = $fs.height(); + + $libContent.find(".dataTables_scrolling").css("max-height", tableHeight - searchHeight); } oTable = $libTable.dataTable( { @@ -784,10 +793,14 @@ var AIRTIME = (function(AIRTIME) { $libContent.on("click", "legend", function(){ $simpleSearch = $libContent.find("#library_display_filter label"); - var $fs = $(this).parents("fieldset"); + var $fs = $(this).parents("fieldset"), + searchHeight, + tableHeight = getTableHeight(), + height; if ($fs.hasClass("closed")) { $fs.removeClass("closed"); + searchHeight = $fs.height(); //keep value of simple search for when user switches back to it simpleSearchText = $simpleSearch.find('input').val(); @@ -796,6 +809,10 @@ var AIRTIME = (function(AIRTIME) { $(".dataTables_filter input").val("").keyup(); $simpleSearch.addClass("sp-invisible"); + + //resize the library table to avoid a double scroll bar. CC-4504 + height = tableHeight - searchHeight; + $libContent.find(".dataTables_scrolling").css("max-height", height); } else { // clear the advanced search fields @@ -817,9 +834,13 @@ var AIRTIME = (function(AIRTIME) { $simpleSearch.removeClass("sp-invisible"); $fs.addClass("closed"); + + //resize the library table to avoid a double scroll bar. CC-4504 + $libContent.find(".dataTables_scrolling").css("max-height", tableHeight); } }); + var tableHeight = getTableHeight(); $libContent.find(".dataTables_scrolling").css("max-height", tableHeight); AIRTIME.library.setupLibraryToolbar(oTable); diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index afe05bd9c..b33a16942 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -1451,13 +1451,13 @@ var AIRTIME = (function(AIRTIME){ widgetHeight = viewport.height - 185; width = Math.floor(viewport.width - 80); - var libTableHeight = widgetHeight - 130; + var libTableHeight = widgetHeight - 175; if (!$pl.is(':hidden')) { $lib.height(widgetHeight) .find(".dataTables_scrolling") - .css("max-height", libTableHeight) - .end() + .css("max-height", libTableHeight) + .end() .width(Math.floor(width * 0.55)); $pl.height(widgetHeight) @@ -1465,8 +1465,8 @@ var AIRTIME = (function(AIRTIME){ } else { $lib.height(widgetHeight) .find(".dataTables_scrolling") - .css("max-height", libTableHeight) - .end() + .css("max-height", libTableHeight) + .end() .width(width + 40); } } @@ -1475,8 +1475,6 @@ var AIRTIME = (function(AIRTIME){ $lib = $("#library_content"); $pl = $("#side_playlist"); - - setWidgetSize(); AIRTIME.library.libraryInit(); diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index 5d7101cba..df00eb7a5 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -186,10 +186,10 @@ function buildScheduleDialog (json, instance_id) { //set max heights of datatables. dialog.find(".lib-content .dataTables_scrolling") - .css("max-height", height - 90 - 155); + .css("max-height", height - 90 - 200); dialog.find(".sb-content .dataTables_scrolling") - .css("max-height", height - 90 - 60); + .css("max-height", height - 90 - 65); dialog.dialog('open'); } diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index 517ae1ba0..e411a4c1d 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -54,7 +54,7 @@ AIRTIME = (function(AIRTIME) { widgetHeight = viewport.height - 180; screenWidth = Math.floor(viewport.width - 40); - var libTableHeight = widgetHeight - 130, + var libTableHeight = widgetHeight - 175, builderTableHeight = widgetHeight - 95, oTable;