2013-08-08 Koichiro Kikuchi <koichiro@rworks.jp>

* index.php: Fixed footer layout probrems: Now we can see the
	 footer at the browser bottom when reducing the browser height.
	 Also fixes the footer overlay probrem in some pages (e.g.
	 "Modules in policy" page).



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8647 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
koichirok 2013-08-08 14:05:57 +00:00
parent 1e95f6eb64
commit 8b705f701c
2 changed files with 31 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2013-08-08 Koichiro Kikuchi <koichiro@rworks.jp>
* index.php: Fixed footer layout probrems: Now we can see the
footer at the browser bottom when reducing the browser height.
Also fixes the footer overlay probrem in some pages (e.g.
"Modules in policy" page).
2013-08-08 Miguel de Dios <miguel.dedios@artica.es>
* images/zoom_default.svg: tiny fixes make for Carla.

View File

@ -570,18 +570,34 @@ require('include/php_to_js_values.php');
?>
<script type="text/javascript" language="javascript">
//Dynamically assign footer position and width.
//Initial load of page
$(document).ready(sizeContent);
$(document).ready(adjustFooter);
//Every resize of window
$(window).resize(sizeContent);
$(window).resize(adjustFooter);
//Every resize (height change) of div#container
container_height = $('#container').height();
$('#container').bind((window.opera ? 'DOMAttrModified' : 'DOMSubtreeModified'), function() {
if (container_height != $('#container').height()) {
container_height = $('#container').height();
adjustFooter();
}
});
//Dynamically assign height
function sizeContent() {
var footposition_bottom = $('#foot').position().top + $("#foot").height();
function adjustFooter() {
// highest Y pos for #foot
var ulim = $('#container').position().top + $('#container').outerHeight(true);
// $(window).height() returns wrong value on Opera and Google Chrome.
var wh = $(window).height(); //document.documentElement.clientHeight;
var h = $('#foot').height();
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
if (footposition_bottom < $(window).height()) {
$('#container').css('height', $(window).height() - $("#foot").height() - 15 + 'px');
}
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
$('#foot').width($(window).width());
$('#foot').height(h);
}
</script>