changing jquery to detect number of products for the category gallery
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 29 Jun 2016 13:30:45 +0000 (09:30 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 29 Jun 2016 13:30:45 +0000 (09:30 -0400)
js/app.js
js/custom/pageSetup.js

index 0248936..7c9cbaa 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -96,10 +96,10 @@ $(document).ready(function () {
         $(this).find('img').remove();
     });
     
-    var products = $(".type-product").length;
-    
-    if(products == 2){
-        $("#container").css("width", "700px");
+    var products = $("ul.products").find("li.type-product").length;
+    console.debug(products);
+    if(products < 3 && products > 0){
+        $("#container").css("width", "1000px");
     }
     
     $(".html5_video_tab").find('a').html("Video");
index d539c1d..3ea5a64 100644 (file)
@@ -87,10 +87,10 @@ $(document).ready(function () {
         $(this).find('img').remove();
     });
     
-    var products = $(".type-product").length;
-    
-    if(products == 2){
-        $("#container").css("width", "700px");
+    var products = $("ul.products").find("li.type-product").length;
+    console.debug(products);
+    if(products < 3 && products > 0){
+        $("#container").css("width", "1000px");
     }
     
     $(".html5_video_tab").find('a').html("Video");