Skip to content
Snippets Groups Projects
Commit 05cbdadb authored by gnaegi's avatar gnaegi
Browse files

OO-817 use as much space as possible for question pool layout

parent 05cfaa6b
No related branches found
No related tags found
No related merge requests found
...@@ -20,16 +20,30 @@ ...@@ -20,16 +20,30 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { ## global variable to initialize the qPool view
var width = jQuery('#b_col3_content_inner').width(); var qPoolInit = function() {
var winHeight = jQuery(window).height(); if (jQuery('#qpoolcontainer').length == 0) {
var headerHeight = jQuery('#b_header').height() + jQuery('#b_nav_main').height(); ## detatch on-resize code and remove global method code
var footerHeight = jQuery('#b_footer').height() + jQuery('#qbuttons').height(); jQuery(window).off("resize", qPoolInit);
var maxHeight = winHeight - headerHeight - footerHeight - 50; delete window.qPoolInit;
}
## padding arount table = relative position of table (space for search field) + height of action buttons below table + some extra space ## padding arount table = relative position of table (space for search field) + height of action buttons below table + some extra space
var dataTablesPos = jQuery('.dataTables_wrapper').position() var dataTablesPos = jQuery('.dataTables_wrapper').position()
var panePadding = (dataTablesPos ? dataTablesPos.top : 0) + jQuery('.o_qpool_button_bar_box').height() + 80; var panePadding = (dataTablesPos ? dataTablesPos.top : 0) + jQuery('.o_qpool_button_bar_box').height() + jQuery('.b_table_footer').height() + 80;
## Calculate max height to use full browser height minus the header. Footer can be pushed below to max for table space
var winHeight = jQuery(window).height();
var containerTop = jQuery('#qpoolcontainer').offset().top;
var buttonsHeight = jQuery('#qbuttons').height()
var maxHeight = winHeight - containerTop - buttonsHeight;
## Add footer when enouth space
if (maxHeight > 1000) {
maxHeight -= jQuery('#b_footer').height() + 50;
}
## Calculate width and height for layouter
var width = jQuery('#b_col3_content_inner').width();
var northHeight = '$northHeight'; var northHeight = '$northHeight';
var westWidth = '$westWidth'; var westWidth = '$westWidth';
var centerWidth = '50%'; var centerWidth = '50%';
...@@ -67,5 +81,11 @@ jQuery(function() { ...@@ -67,5 +81,11 @@ jQuery(function() {
oSettings.oScroll.sY = (paneHeight - panePadding) + "px"; oSettings.oScroll.sY = (paneHeight - panePadding) + "px";
jQuery('div.dataTables_scrollBody', jQuery('#qitems')).height(paneHeight - panePadding); jQuery('div.dataTables_scrollBody', jQuery('#qitems')).height(paneHeight - panePadding);
}); });
}
## initialize pool view when done with rendering and execute again on window resize
jQuery(function() {
qPoolInit();
jQuery(window).on("resize", qPoolInit);
}); });
</script> </script>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment