From 5f026bb847aecf63d385137d8783a31349f48dd8 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 20 Jun 2012 21:24:35 +0000 Subject: [PATCH] hide the manage pubs and manage grants links if there are no pubs or grants --- productMods/css/individual/individual-vivo.css | 2 +- productMods/js/individual/individualUtils.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/productMods/css/individual/individual-vivo.css b/productMods/css/individual/individual-vivo.css index 3ba1472f..fcca1964 100644 --- a/productMods/css/individual/individual-vivo.css +++ b/productMods/css/individual/individual-vivo.css @@ -241,7 +241,7 @@ a.qrCloseLink { background: #f4f4f4; } /* <---- Manage Prop Link, individual-properties.ftl -----*/ -a#managePropLink { +a.manageLinks { float:right;font-size:.8em; padding-right:10px; display:inline; diff --git a/productMods/js/individual/individualUtils.js b/productMods/js/individual/individualUtils.js index ac5c94e3..333613cf 100644 --- a/productMods/js/individual/individualUtils.js +++ b/productMods/js/individual/individualUtils.js @@ -97,4 +97,16 @@ $(document).ready(function(){ $('#qrCodeImage').toggleClass('hidden'); return false; }); + + // if there are no selected pub, hide the manage link; same for grants + if ( $('ul#authorInAuthorshipList').children('li').length < 1 ) { + $('a#managePropLink').hide(); + } + if ( $('ul#hasResearcherRoleList').children('li').length < 1 && + $('ul#hasPrincipalInvestigatorRoleList').children('li').length < 1 && + $('ul#hasCo-PrincipalInvestigatorRoleList').children('li').length < 1 && + $('ul#hasInvestigatorRoleList').children('li').length < 1 ) { + $('a#manageGrantLink').hide(); + } + });