diff --git a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js index 31ade57fa..c3d89ac52 100644 --- a/public/js/lehre/lehrauftrag/acceptLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/acceptLehrauftrag.js @@ -93,6 +93,11 @@ function hf_filterStringnumberWithOperator(headerValue, rowValue, rowData){ // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- +// Returns relative height (depending on screen size) +function func_height(table){ + return $(window).height() * 0.50; +} + // Displays text when table is empty function func_placeholder() { @@ -432,6 +437,13 @@ storniert_tooltip = function(cell){ } $(function() { + + // Redraw table on resize to fit tabulators height to windows height + window.addEventListener('resize', function(){ + $('#tableWidgetTabulator').tabulator('setHeight', $(window).height() * 0.50); + $('#tableWidgetTabulator').tabulator('redraw', true); + }); + // Show all rows $("#show-all").click(function(){ $('#tableWidgetTabulator').tabulator('clearFilter'); diff --git a/public/js/lehre/lehrauftrag/approveLehrauftrag.js b/public/js/lehre/lehrauftrag/approveLehrauftrag.js index f38d251c0..29e2d9651 100644 --- a/public/js/lehre/lehrauftrag/approveLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/approveLehrauftrag.js @@ -106,6 +106,11 @@ function func_initialFilter(){ // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- +// Returns relative height (depending on screen size) +function func_height(table){ + return $(window).height() * 0.50; +} + // Displays text when table is empty function func_placeholder() { @@ -492,6 +497,12 @@ akzeptiert_tooltip = function(cell){ } $(function() { + // Redraw table on resize to fit tabulators height to windows height + window.addEventListener('resize', function(){ + $('#tableWidgetTabulator').tabulator('setHeight', $(window).height() * 0.50); + $('#tableWidgetTabulator').tabulator('redraw', true); + }); + // Show all rows $("#show-all").click(function(){ $('#tableWidgetTabulator').tabulator('clearFilter'); diff --git a/public/js/lehre/lehrauftrag/orderLehrauftrag.js b/public/js/lehre/lehrauftrag/orderLehrauftrag.js index a9a59efbb..6471d988f 100644 --- a/public/js/lehre/lehrauftrag/orderLehrauftrag.js +++ b/public/js/lehre/lehrauftrag/orderLehrauftrag.js @@ -111,6 +111,11 @@ function func_dataLoaded(data, table){ // Tabulator table format functions // ----------------------------------------------------------------------------------------------------------------- +// Returns relative height (depending on screen size) +function func_height(table){ + return $(window).height() * 0.50; +} + // Displays text when table is empty function func_placeholder() { @@ -509,6 +514,12 @@ akzeptiert_tooltip = function(cell){ $(function() { + // Redraw table on resize to fit tabulators height to windows height + window.addEventListener('resize', function(){ + $('#tableWidgetTabulator').tabulator('setHeight', $(window).height() * 0.50); + $('#tableWidgetTabulator').tabulator('redraw', true); + }); + // Show all rows $("#show-all").click(function(){ $('#tableWidgetTabulator').tabulator('clearFilter');