CC-4504 : Double scrollbars in Library view
This commit is contained in:
parent
b18495a79e
commit
01f835c4c4
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -186,7 +186,7 @@ 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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue