mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-08-14 Koichiro Kikuchi <koichiro@rworks.jp>
* index.php: Improve footer layout. MERGED FROM branch_4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8663 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e0f3d33362
commit
4eeb07ccc3
@ -1,3 +1,9 @@
|
|||||||
|
2013-08-14 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||||
|
|
||||||
|
* index.php: Improve footer layout.
|
||||||
|
|
||||||
|
MERGED FROM branch_4.0
|
||||||
|
|
||||||
2013-08-13 Ramon Novoa <rnovoa@artica.es>
|
2013-08-13 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* include/help/es/help_snmp_alert_custom.php,
|
* include/help/es/help_snmp_alert_custom.php,
|
||||||
|
@ -571,33 +571,49 @@ require('include/php_to_js_values.php');
|
|||||||
|
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
|
|
||||||
//Dynamically assign footer position and width.
|
|
||||||
//Initial load of page
|
//Initial load of page
|
||||||
$(document).ready(adjustFooter);
|
$(document).ready(adjustFooter);
|
||||||
|
|
||||||
//Every resize of window
|
//Every resize of window
|
||||||
$(window).resize(adjustFooter);
|
$(window).resize(adjustFooter);
|
||||||
|
|
||||||
//Every resize (height change) of div#container
|
//Every show/hide call may need footer re-layout
|
||||||
container_height = $('#container').height();
|
(function() {
|
||||||
$('#container').bind((window.opera ? 'DOMAttrModified' : 'DOMSubtreeModified'), function() {
|
var oShow = jQuery.fn.show;
|
||||||
if (container_height != $('#container').height()) {
|
var oHide = jQuery.fn.hide;
|
||||||
container_height = $('#container').height();
|
|
||||||
adjustFooter();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//Dynamically assign height
|
jQuery.fn.show = function () {
|
||||||
|
var rv = oShow.apply(this, arguments);
|
||||||
|
adjustFooter();
|
||||||
|
return rv;
|
||||||
|
};
|
||||||
|
jQuery.fn.hide = function () {
|
||||||
|
var rv = oHide.apply(this, arguments);
|
||||||
|
adjustFooter();
|
||||||
|
return rv;
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
//Dynamically assign footer position and width.
|
||||||
function adjustFooter() {
|
function adjustFooter() {
|
||||||
// highest Y pos for #foot
|
if (document.readyState !== 'complete') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// minimum top value (upper limit) for div#foot
|
||||||
var ulim = $('#container').position().top + $('#container').outerHeight(true);
|
var ulim = $('#container').position().top + $('#container').outerHeight(true);
|
||||||
// $(window).height() returns wrong value on Opera and Google Chrome.
|
// window height. $(window).height() returns wrong value on Opera and Google Chrome.
|
||||||
var wh = $(window).height(); //document.documentElement.clientHeight;
|
var wh = document.documentElement.clientHeight;
|
||||||
|
// save div#foot's height for latter use
|
||||||
var h = $('#foot').height();
|
var h = $('#foot').height();
|
||||||
|
// new top value for div#foot
|
||||||
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
|
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
|
||||||
|
|
||||||
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
|
if ($('#foot').position().top != t) {
|
||||||
$('#foot').width($(window).width());
|
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
|
||||||
$('#foot').height(h);
|
$('#foot').height(h);
|
||||||
|
}
|
||||||
|
if ($('#foot').width() != $(window).width()) {
|
||||||
|
$('#foot').width($(window).width());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user