From 107b13d7c0b210625bc8e83bbeeb6530fe376c47 Mon Sep 17 00:00:00 2001 From: tworrall Date: Tue, 14 May 2013 16:18:36 -0400 Subject: [PATCH] when navigating from the map to the list of researchers, expand the list if there are more than 5 --- .../js/individual/propertyGroupControls.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/productMods/js/individual/propertyGroupControls.js b/productMods/js/individual/propertyGroupControls.js index 27ab7a7d..2e4e6d20 100644 --- a/productMods/js/individual/propertyGroupControls.js +++ b/productMods/js/individual/propertyGroupControls.js @@ -86,6 +86,9 @@ $(document).ready(function(){ // show the selected tab section $('section#' + tabName).show(); } + // if there is a more link, "click" more to show all the researchers + // we need the timeout delay so that the more link can get rendered + setTimeout(geoFocusExpand,250); } else { retrieveLocalStorage(); @@ -96,6 +99,21 @@ $(document).ready(function(){ } } + function geoFocusExpand() { + // if the ontology is set to collate by subclass, $list.length will be > 0 + // this ensures both possibilities are covered + var $list = $('ul#geographicFocusOfList').find('ul'); + if ( $list.length > 0 ) + { + var $more = $list.find('a.more-less'); + $more.click(); + } + else { + var $more = $('ul#geographicFocusOfList').find('a.more-less'); + $more.click(); + } + } + // Next two functions -- keep track of which property group tab was selected, // so if we return from a custom form or a related individual, even via the back button, // the same property group will be selected as before.