From 75a4d7eb9d111a38254747504637d80f7d938b9d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 23 Aug 2010 18:01:06 +0000 Subject: [PATCH] scroll only account table --- lam/lib/lists.inc | 25 ++++++++++++++++--------- lam/templates/lib/500_lam.js | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index 84f3e12c..590155ce 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -162,6 +162,7 @@ class lamList { } // show form echo "
"; + echo "
\n"; echo ("
type . "&norefresh=true\" method=\"post\">\n"); // draw account list if accounts were found if (sizeof($this->entries) > 0) { @@ -171,10 +172,12 @@ class lamList { // navigation bar $this->listDrawNavigationBar(sizeof($this->entries)); echo ("
\n"); + echo "
"; // account table head $this->listPrintTableHeader(); // account table body $this->listPrintTableBody($this->entries); + echo "
"; } else { // buttons @@ -315,7 +318,7 @@ class lamList { */ protected function listPrintTableHeader() { // print table header - echo "type . "list\" width=\"100%\">\n"; + echo "
type . "list\" width=\"100%\">\n"; echo "type . "list-dark\">\n\n\n"; // table header for ($k = 0; $k < sizeof($this->descArray); $k++) { @@ -354,7 +357,7 @@ class lamList { echo ("attrArray[$k]) ."\"" . $value . " onkeypress=\"SubmitForm('apply_filter', event)\">"); echo "\n"; } - echo "\n"; + echo "\n"; } /** @@ -363,6 +366,7 @@ class lamList { * @param array $info entries */ protected function listPrintTableBody(&$info) { + echo "\n"; // calculate which rows to show $table_begin = ($this->page - 1) * $this->maxPageEntries; if (($this->page * $this->maxPageEntries) > sizeof($info)) $table_end = sizeof($info); @@ -396,11 +400,12 @@ class lamList { // display select all link $colspan = sizeof($this->attrArray) + 1; echo "type . "list-bright\">\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo ("
\"select\"select " . "" . _("Select all") . "
"); + echo "\n"; + echo "\n"; } /** @@ -692,17 +697,19 @@ class lamList { */ protected function listPrintHeader() { include '../main_header.php'; - echo ''; } /** * Prints the HTML footer. */ protected function listPrintFooter() { - echo ("
\n"); + echo ("
\n"); + echo ''; include '../main_footer.php'; } diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index f911dd4f..97a326e2 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -50,6 +50,23 @@ function listOUchanged(type, element) { location.href='list.php?type=' + type + '&suffix=' + element.options[element.selectedIndex].value; } +/** + * Resizes the content area of the account lists to fit the window size. + * This prevents that the whole page is scrolled in the browser. Only the account table has scroll bars. + */ +function listResizeITabContentDiv() { + var myDiv = document.getElementById("listTabContentArea"); + var height = document.documentElement.clientHeight; + height -= myDiv.offsetTop; + height -= 90 + myDiv.style.height = height +"px"; + + var myDivScroll = document.getElementById("listScrollArea"); + var top = myDivScroll.offsetTop; + var scrollHeight = height - (top - myDiv.offsetTop); + myDivScroll.style.height = scrollHeight + "px"; +}; + function SubmitForm(id, e) { if (e.keyCode == 13) { document.getElementsByName(id)[0].click();