@widelab-nc/widelab 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widelab-nc/widelab",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Widelab starter template based on Finsweet template + add-ons.",
5
5
  "homepage": "https://widelab.co",
6
6
  "license": "ISC",
package/src/index.js CHANGED
@@ -957,9 +957,23 @@ function customGsapEasing() {
957
957
 
958
958
  // Update the scroll trigger on page load
959
959
  window.updateScrollTrigger = function() {
960
- window.onload = function() {
961
- ScrollTrigger.update();
962
- };
960
+ const sections = document.querySelectorAll('.section');
961
+
962
+ const observer = new MutationObserver(function(mutationsList) {
963
+ for(let mutation of mutationsList) {
964
+ if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
965
+ ScrollTrigger.update();
966
+ console.log('Height change')
967
+ break;
968
+ }
969
+ }
970
+ });
971
+
972
+ const config = { attributes: true, childList: true, subtree: true };
973
+
974
+ sections.forEach(function(section) {
975
+ observer.observe(section, config);
976
+ });
963
977
  }
964
978
 
965
979