Area map category box retains 'selected' class when any subcat dropdown item is selected
authorLaury GvR <laury@gaslightmedia.com>
Thu, 27 Dec 2018 15:15:35 +0000 (10:15 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 27 Dec 2018 15:15:35 +0000 (10:15 -0500)
js/leaflet-area-map.js
views/front/members/interactivemap.html

index 3b7abdb..32e1127 100644 (file)
@@ -47,6 +47,15 @@ var GlmMap = {
             jQuery("#cat-main-close-" + category_id).click(function(){
                 jQuery("#cat-main-" + category_id).slideUp(GlmMap._catDivSpeed).parent().toggleClass("open");
             });
+            jQuery("#cat-main-" + category_id + " .catLabel input[type='checkbox']").click(function() {
+                var anySubCatSelected = false;
+                jQuery("#cat-main-" + category_id + " .catLabel input[type='checkbox']").each(function() {
+                    if ($(this)[0].checked) {
+                        anySubCatSelected = true;
+                    }
+                });
+                jQuery("#cat-" + category_id).toggleClass("selected", anySubCatSelected);
+            });
         });
         jQuery("#memLocHdr").click(function (){
             GlmMap._showLocations();
index 4235c83..895cf25 100644 (file)
@@ -358,6 +358,7 @@ ul#memberCategoryBox li.categoryBox {
     width: 14.1%;
     /*width: auto;*/
 }
+ul#memberCategoryBox li.categoryBox.selected .catName,
 ul#memberCategoryBox li.categoryBox.open .catName {
     background: #555555;
 }