From cf0c1a3401add23f35101838947afc9a869b9c40 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 29 Jun 2016 09:30:45 -0400 Subject: [PATCH] changing jquery to detect number of products for the category gallery --- js/app.js | 8 ++++---- js/custom/pageSetup.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/js/app.js b/js/app.js index 0248936..7c9cbaa 100644 --- 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"); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index d539c1d..3ea5a64 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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"); -- 2.17.1