KenPrz / HomeSphere

1 stars 0 forks source link

Addressing Unmaintainable Modal Open/Close Functions #7

Closed KenPrz closed 1 year ago

KenPrz commented 1 year ago

Issue Description:

The current codebase contains scattered and hard-to-maintain functions for opening and closing modals throughout the application. This has led to redundancy, code duplication, and inconsistency in how modals are managed across different parts of the codebase.

Proposed Solution:

To improve code maintainability and reduce redundancy, we should work on creating a single, centralized function for opening and closing modals. This function should be designed to handle various modal types and scenarios, improving the consistency of modal behavior throughout the application.

KenPrz commented 1 year ago

addressed

through

function toggleElementVisibility(elementId) {
    const element = document.getElementById(elementId);
    if (element) {
        console.log("clicked")
        element.classList.toggle('hidden');
    } else {
        console.error(`Element with ID '${elementId}' not found.`);
    }
}