From 18f3020785e855acf2fb72e9c302078b01d04d33 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 28 Feb 2018 19:02:54 +0100 Subject: [PATCH] Change fixed header and fixed menu positions - #1844 --- .../godmode/setup/setup_visuals.php | 1 + .../include/javascript/jquery.pandora.js | 63 +++++++++++++++++-- pandora_console/index.php | 2 +- 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index adb686bf05..bbe0e20d27 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -288,6 +288,7 @@ $table_styles->data[$row][1] = __('Yes') . ' ' . '  '; $table_styles->data[$row][1] .= __('No') . ' ' . html_print_radio_button ('fixed_menu', 0, '', $config["fixed_menu"], true); +$row++; // For 5.1 Autohidden menu feature $table_styles->data['autohidden'][0] = __('Autohidden menu'); diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index fd0972e750..c3b2e65c6c 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -226,12 +226,65 @@ $(document).ready (function () { $(document).on("scroll", function(){ - if((document.documentElement.scrollTop != 0 || document.body.scrollTop != 0) && $('#menu').css('position') =='fixed'){ - $('#menu').css('top','20px'); - } - else{ - $('#menu').css('top','80px'); + + if(document.documentElement.scrollTop != 0 || document.body.scrollTop != 0){ + if($('#head').css('position') =='fixed'){ + if($('#menu').css('position') =='fixed'){ + $('#menu').css('top','80px'); + } + else{ + $('#menu').css('top','60px'); + } + } + else{ + if($('#menu').css('position') =='fixed'){ + $('#menu').css('top','20px'); + } + else{ + $('#menu').css('top','80px'); + } + } } + else{ + if($('#head').css('position') =='fixed'){ + if($('#menu').css('position') =='fixed'){ + $('#menu').css('top','80px'); + } + else{ + $('#menu').css('top','60px'); + } + } + else{ + if($('#menu').css('position') =='fixed'){ + $('#menu').css('top','80px'); + } + else{ + $('#menu').css('top','80px'); + } + } + } + + // if((document.documentElement.scrollTop != 0 || document.body.scrollTop != 0) && $('#menu').css('position') =='fixed'){ + // if($('#head').css('position') =='fixed'){ + // $('#menu').css('top','80px'); + // } + // else{ + // $('#menu').css('top','20px'); + // } + // } + // else{ + // if($('#head').css('position') =='fixed'){ + // if(document.documentElement.scrollTop != 0 || document.body.scrollTop != 0){ + // $('#menu').css('top','60px'); + // }else{ + // $('#menu').css('top','80px'); + // } + // + // } + // else{ + // $('#menu').css('top','60px'); + // } + // } }); $("#alert_messages").draggable(); diff --git a/pandora_console/index.php b/pandora_console/index.php index ed9eb48f9d..b283be0785 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -951,7 +951,7 @@ if ($config["pure"] == 0) { else { echo '
'; }