From c02146eaff60c80d15f1d799a71fe05fc5199c2e Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 28 Aug 2018 15:17:11 -0400 Subject: [PATCH] Added console test statements to discover jquery error in footer on certain systems --- functions.php | 4 ++-- js/app.js | 7 +++++++ js/custom/pageSetup.js | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index c410b5e..e5a9748 100644 --- a/functions.php +++ b/functions.php @@ -165,9 +165,9 @@ function glm_site_scripts() wp_enqueue_script('jquery'); wp_enqueue_script( 'glm_foundation', - get_template_directory_uri() . '/js/app.js?v=1.0.19', + get_template_directory_uri() . '/js/app.js', 'jquery', - '1.0.9', + '1.0.19.0', true ); if(is_front_page()) { diff --git a/js/app.js b/js/app.js index 7f42a9c..a320851 100644 --- a/js/app.js +++ b/js/app.js @@ -50,11 +50,18 @@ $(document).ready(function () { }) $('.manufacturer-brand').each(function(){ let url = $(this).children('a').attr('href'); + console.log($(this)); + console.log("Length of children:"); + console.log($(this).children('ul').length); if( $(this).children('ul').length <= 0 || $(this).children('ul').css("touch-action") === "manipulation"){ + + console.log("Has children"); // $(this).attr('data-url', url); $(this).on("click", function(){ window.location = url; }) + } else { + console.log("Has no children"); } }) } diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 95ef1af..8c7fcca 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -41,11 +41,18 @@ $(document).ready(function () { }) $('.manufacturer-brand').each(function(){ let url = $(this).children('a').attr('href'); + console.log($(this)); + console.log("Length of children:"); + console.log($(this).children('ul').length); if( $(this).children('ul').length <= 0 || $(this).children('ul').css("touch-action") === "manipulation"){ + + console.log("Has children"); // $(this).attr('data-url', url); $(this).on("click", function(){ window.location = url; }) + } else { + console.log("Has no children"); } }) } -- 2.17.1