From f6090cd7e55de4831b9ed124595049cec414ed17 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Fri, 11 Dec 2020 02:36:54 +0000 Subject: [PATCH] fix: JS when Portfolio widget created without a toolbar --- wowchemy/assets/js/wowchemy.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wowchemy/assets/js/wowchemy.js b/wowchemy/assets/js/wowchemy.js index 1fb082e6..283ef8fa 100644 --- a/wowchemy/assets/js/wowchemy.js +++ b/wowchemy/assets/js/wowchemy.js @@ -491,7 +491,11 @@ $(window).on('load', function () { } // Get default filter (if any) for this instance - let filterText = isoSection.querySelector('.default-project-filter').textContent || '*'; + let defaultFilter = isoSection.querySelector('.default-project-filter'); + let filterText = '*'; + if (defaultFilter !== null) { + filterText = defaultFilter.textContent; + } console.debug(`Default Isotope filter: ${filterText}`); // Init Isotope instance once its images have loaded.