소스 검색

fix: JS when Portfolio widget created without a toolbar

George Cushen 4 년 전
부모
커밋
f6090cd7e5
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      wowchemy/assets/js/wowchemy.js

+ 5 - 1
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.