diff --git a/_dev/js/theme/windowExpose.js b/_dev/js/theme/windowExpose.js index df4c7de3..a7e8b353 100644 --- a/_dev/js/theme/windowExpose.js +++ b/_dev/js/theme/windowExpose.js @@ -7,6 +7,7 @@ import useHttpPayloadDefinition from "../utils/http/useHttpPayloadDefinition"; import { isElementVisible, each, DOMReady, parseToHtml } from '../utils/DOM/DOMHelpers'; import { getAllSiblingsBeforeElement, getAllSiblingsAfterElement } from '../utils/DOM/DOMSelectorsHelper'; import { fromSerializeObject, fromSerialize, formSerializeArray } from '../utils/form/formSerialize'; +import useToggleDisplay from "../utils/display/useToggleDisplay"; exposeToWindow('eventHandlerOn', on); exposeToWindow('eventHandlerOne', one); @@ -25,4 +26,4 @@ exposeToWindow('getAllSiblingsAfterElement', getAllSiblingsAfterElement); exposeToWindow('fromSerializeObject', fromSerializeObject); exposeToWindow('fromSerialize', fromSerialize); exposeToWindow('formSerializeArray', formSerializeArray); - +exposeToWindow('useToggleDisplay', useToggleDisplay); diff --git a/_dev/js/utils/display/useToggleDisplay.js b/_dev/js/utils/display/useToggleDisplay.js index be754ad9..ac479d73 100644 --- a/_dev/js/utils/display/useToggleDisplay.js +++ b/_dev/js/utils/display/useToggleDisplay.js @@ -1,6 +1,4 @@ -const useToggleDisplay = () => { - const D_NONE_CLASS = 'd-none'; - +const useToggleDisplay = (hideClass = 'd-none') => { /** * Show element * @param element {HTMLElement} Element to show @@ -8,7 +6,7 @@ const useToggleDisplay = () => { */ const show = (element) => { element.style.display = ''; - element.classList.remove(D_NONE_CLASS); + element.classList.remove(hideClass); }; /** @@ -18,7 +16,7 @@ const useToggleDisplay = () => { */ const hide = (element) => { element.style.display = ''; - element.classList.add(D_NONE_CLASS); + element.classList.add(hideClass); }; /**