Auto-expand member detail tabs only in large view
authorLaury GvR <laury@gaslightmedia.com>
Mon, 10 Apr 2017 15:06:09 +0000 (11:06 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 10 Apr 2017 15:06:09 +0000 (11:06 -0400)
Added some jquery to make sure the member detail tabs on the front
-end only expand on load if the window width is over 1024

glm-member-db/views/front/members/detail.html

index 7ab2fa5..751061b 100644 (file)
                 fullProfileCheck(target);
             });
             
-            $('.glm-member-detail-sub-data-links').each(function() {
-                var target = $(this).parent().attr("id").slice(0, -10);
-                $("#"+target+"-container").slideToggle("fast", "swing",  function() {});
-                $("#"+target+"-toggle").toggleClass("selected");
-            })
+            if ($(window).width() >= 1024) {
+                $('.glm-member-detail-sub-data-links').each(function() {
+                    var target = $(this).parent().attr("id").slice(0, -10);
+                    $("#"+target+"-container").slideToggle("fast", "swing",  function() {});
+                    $("#"+target+"-toggle").toggleClass("selected");
+                });
+            }
 
             // Change the toggle button based on whether all the content sections are expanded
             function fullProfileCheck(target) {