@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
32 lines • 1.09 kB
JavaScript
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function updateSectionCSS(thisDiv, prop, value) {
if (thisDiv.style) {
thisDiv.style[prop] = value;
}
else {
thisDiv.style = {};
thisDiv.style[prop] = value;
}
}
export function getSectionCount(skipClasses) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const divs = Array.from(document.querySelectorAll('.CanvasZone'));
/**
* Changed logic to resolve https://github.com/mikezimm/Slick-Sections/issues/99
* 2024-07-22: Noticed MSFT changed something causing Title to be recognized as a CanvasZone
*/
let NonTitleSectionCount = 0;
divs.forEach((el) => {
let ignoreEle = false;
skipClasses.map(skipMe => {
if (el.classList.contains(skipMe)) {
ignoreEle = true;
}
});
if (ignoreEle !== true) {
NonTitleSectionCount++;
}
});
return NonTitleSectionCount;
}
//# sourceMappingURL=updateSectionCSS.js.map