From 76d79c5e538cfe68e9ffcba7b6b7d7376d976979 Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 19 Dec 2013 13:33:10 -0500 Subject: [PATCH] minor js tweak; would not have been a blocker issue --- productMods/js/homePageMaps.js | 36 +++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/productMods/js/homePageMaps.js b/productMods/js/homePageMaps.js index 01908fd3..fd08151d 100644 --- a/productMods/js/homePageMaps.js +++ b/productMods/js/homePageMaps.js @@ -5,6 +5,7 @@ $(document).ready(function(){ var globalMapBuilt = false; var countryMapBuilt = false; var localMapBuilt = false; + var legendIsVisible = false; var researchAreas = { "type": "FeatureCollection", "features": []}; var geoResearcherCount = "0"; @@ -412,13 +413,15 @@ $(document).ready(function(){ function getResearcherCount(area) { + var localResearcherCount = 0; var areaCount = 0; + var displayCount = ""; var text = ""; if ( area == "global" ) { text = " " + i18nStrings.countriesAndRegions; } else if ( area == "country" ) { - text = " " + i18nStrings.stateString; + text = " " + i18nStrings.statesString; } else { text = " " + i18nStrings.statewideLocations; @@ -426,6 +429,7 @@ $(document).ready(function(){ $.each(researchAreas.features, function() { if ( this.properties.mapType == area ) { + localResearcherCount = localResearcherCount + this.properties.html ; areaCount = areaCount + 1; } }); @@ -433,27 +437,45 @@ $(document).ready(function(){ if ( areaCount == 1 && text == " states.") { text = " " + i18nStrings.stateString; } - if ( geoResearcherCount == 1 ) { - researcherText = " " + i18nStrings.researcherString + " " + i18nStrings.inString; + + if ( area == "global" ) { + if ( geoResearcherCount == 1 ) { + researcherText = " " + i18nStrings.researcherString + " " + i18nStrings.inString; + } + else { + researcherText = " " + i18nStrings.researchersString + " " + i18nStrings.inString; + } + + displayCount = geoResearcherCount; } else { - researcherText = " " + i18nStrings.researchersString + if ( localResearcherCount == 1 ) { + researcherText = " " + i18nStrings.researcherString + " " + i18nStrings.inString; + } + else { + researcherText = " " + i18nStrings.researchersString + " " + i18nStrings.inString; + } + + displayCount = localResearcherCount; } $('div#researcherTotal').html("" - + geoResearcherCount + + displayCount + " " + researcherText + " " + areaCount + "" + text); } function appendLegendToLeafletContainer() { - var htmlString = "