Skip to content

Commit 201a186

Browse files
authored
Merge pull request #13 from TheCodeRaccoons/main
updating develop to main
2 parents d14564d + 9f9c862 commit 201a186

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

Dist/WebflowOnly/HideContainer.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ const SetHideContainers = () => {
55

66
if(!containers || containers.length === 0) return;
77

8-
for(let _container of containers) {
9-
let _cmsList = _container.querySelector('[wt-hidecontainer-element="list"]');
10-
let _r = _container.getAttribute('wt-hidecontainer-remove');
8+
containers.forEach((cmsContainer) => {
9+
let _cmsList = cmsContainer.querySelector('[wt-hidecontainer-element="list"]');
1110
if(!_cmsList) return;
12-
if(_cmsList.classList.contains("w-dyn-empty")) {
13-
if(_r) {
14-
_container.remove();
15-
}
16-
else{
17-
_container.style.display = 'none';
18-
}
19-
}
20-
}
11+
let _r = cmsContainer.getAttribute('wt-hidecontainer-remove');
12+
if(_r) {if(_cmsList.classList.contains("w-dyn-empty")) cmsContainer.remove();}
13+
else{if(_cmsList.classList.contains("w-dyn-empty")) cmsContainer.style.display = 'none';}
14+
});
15+
2116
}
17+
window.addEventListener('DOMContentLoaded', SetHideContainers());

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,8 @@ After a pull request has been open for over 30 days with no activity or response
117117
<img src="https://forthebadge.com/images/badges/built-with-love.svg" />
118118
<img src="https://forthebadge.com/images/badges/built-by-developers.svg" />
119119
</div>
120+
121+
122+
123+
### Disclaimer
124+
Even though this project has Webflow on its name I'm by no means part of the webflow team, just a dev sharing a bit of the work I've done over the years and trying to help out others looking for easier ways to build for the web.

0 commit comments

Comments
 (0)