From a91e4b67fbdb2a07d8d9facf678ea8b4060a1c0d Mon Sep 17 00:00:00 2001 From: Mike Hodge <hodgem@wustl.edu> Date: Fri, 2 Sep 2016 16:00:36 -0500 Subject: [PATCH] XNAT-4501, fix for issue where logo takes up space on page even when it's not visible --- src/main/webapp/WEB-INF/tags/page/xnat.tag | 24 ++++++++++--------- .../xnat-templates/navigations/DefaultTop.vm | 17 ++++++------- .../xnat-templates/screens/QuickSearch.vm | 3 ++- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/main/webapp/WEB-INF/tags/page/xnat.tag b/src/main/webapp/WEB-INF/tags/page/xnat.tag index 12a3c4b5..5169186c 100644 --- a/src/main/webapp/WEB-INF/tags/page/xnat.tag +++ b/src/main/webapp/WEB-INF/tags/page/xnat.tag @@ -556,28 +556,30 @@ ${bodyTop} <script type="text/javascript"> - (function(){ + XNAT.app.adjustHeaderAndNavForLogoSize = function(){ + var header_logo$ = $('#header_logo'); - + // adjust height of header if logo is taller than 65px var hdr_logo_height = header_logo$.height(); if (hdr_logo_height > 65) { jq('.main_header').height(hdr_logo_height + 10); } - - // adjust width of main nav if logo is wider than 175px - var hdr_logo_width = header_logo$.width(); - if (hdr_logo_width > 175) { - jq('#main_nav').width(932 - hdr_logo_width - 20); - } - + + ## Commented out 2016/09/02 (XNAT-4501). I don't think we want to do this (See home page when this takes effect) + ##// adjust width of main nav if logo is wider than 175px + ##var hdr_logo_width = header_logo$.width(); + ##if (hdr_logo_width > 175) { + ## jq('#main_nav').width(932 - hdr_logo_width - 20); + ##} + // //var recent_proj_height = jq('#min_projects_list > div').height(); var recent_proj_height = 67; //jq('#min_projects_list, #min_expt_list').height(recent_proj_height * 5).css({'min-width':349,'overflow-y':'scroll'}); - - })(); + + } // initialize the advanced search method toggler XNAT.app.searchMethodToggler = function(parent$){ diff --git a/src/main/webapp/xnat-templates/navigations/DefaultTop.vm b/src/main/webapp/xnat-templates/navigations/DefaultTop.vm index ee1b596e..fcbd990e 100644 --- a/src/main/webapp/xnat-templates/navigations/DefaultTop.vm +++ b/src/main/webapp/xnat-templates/navigations/DefaultTop.vm @@ -243,7 +243,7 @@ <script type="text/javascript"> - (function() { + XNAT.app.adjustHeaderAndNavForLogoSize = function(){ var header_logo$ = $('#header_logo'); @@ -253,18 +253,19 @@ jq('.main_header').height(hdr_logo_height + 10); } - // adjust width of main nav if logo is wider than 175px - var hdr_logo_width = header_logo$.width(); - if (hdr_logo_width > 175) { - jq('#main_nav').width(932 - hdr_logo_width - 20); - } + ## Commented out 2016/09/02 (XNAT-4501). I don't think we want to do this (See home page when this takes effect) + ##// adjust width of main nav if logo is wider than 175px + ##var hdr_logo_width = header_logo$.width(); + ##if (hdr_logo_width > 175) { + ## jq('#main_nav').width(932 - hdr_logo_width - 20); + ##} // //var recent_proj_height = jq('#min_projects_list > div').height(); - var recent_proj_height = 67 ; + var recent_proj_height = 67; //jq('#min_projects_list, #min_expt_list').height(recent_proj_height * 5).css({'min-width':349,'overflow-y':'scroll'}); - })(); + } // initialize the advanced search method toggler XNAT.app.searchMethodToggler = function(_parent){ diff --git a/src/main/webapp/xnat-templates/screens/QuickSearch.vm b/src/main/webapp/xnat-templates/screens/QuickSearch.vm index 1cc1e950..7668ecc2 100644 --- a/src/main/webapp/xnat-templates/screens/QuickSearch.vm +++ b/src/main/webapp/xnat-templates/screens/QuickSearch.vm @@ -20,6 +20,7 @@ // only show the header logo on the 'home' page $('#header_logo').show(); + XNAT.app.adjustHeaderAndNavForLogoSize(); var frontTabs = new YAHOO.widget.TabView('front_search'); @@ -93,4 +94,4 @@ <div class="clear"></div> </div> -<!-- /QuickSearch --> \ No newline at end of file +<!-- /QuickSearch --> -- GitLab