function togButton(name, state, instant) {
    // Return false if the name is not an string in order to avoid console errors
    if (typeof name != "string") return false;

    // If instant wasn't declared as bool, then make it false
    if (typeof instant != "boolean") instant = false;

    // Get the button, if it does not exist then return false
    var btn = document.querySelector(`#${name}-button`);

    if (!btn) return false;

    // SHOW IT
    if (state) {
        btn.style.opacity = "1";
        // Make it appear in 0.3s
        if (!instant) {
            setTimeout(function addThis() {
                btn.style.visibility = "visible";
            }, 300);
        }
        // Make it appear instantly
        else btn.style.visibility = "visible";
    }
    // HIDE IT
    else {
        btn.style.opacity = "0";
        // Make it dissapear in 0.3s
        if (!instant) {
            setTimeout(function removeThis() {
                btn.style.visibility = "none";
            }, 300);
        }
        // Make it dissapear instantly
        else btn.style.visibility = "none";
    }
    return false;
}
// instant: make the tog instant, to avoid bugs, optional
make the tog instant, to avoid bugs, optional
make the tog instant to avoid bugs optional
function togButton(name, state, instant) {
    if (typeof name != "string") return false;
    if (typeof instant != "boolean") instant = false;
    var btn = document.querySelector(`#${name}-button`);
    if (!btn) return false;
    if (state) {
        btn.style.opacity = "1";
        if (!instant) {
            setTimeout(function addThis() {
                btn.style.visibility = "visible";
            }, 300);
        }
        else btn.style.visibility = "visible";
    }
    else {
        btn.style.opacity = "0";
        if (!instant) {
            setTimeout(function removeThis() {
                btn.style.visibility = "none";
            }, 300);
        }
        else btn.style.visibility = "none";
    }
    return false;
}
function togButton ( name , state , instant ) { if ( typeof name != "string" ) return false ; if ( typeof instant != "boolean" ) instant = false ; var btn = document . querySelector ( ` ${ name } ` ) ; if ( ! btn ) return false ; if ( state ) { btn . style . opacity = "1" ; if ( ! instant ) { setTimeout ( function addThis ( ) { btn . style . visibility = "visible" ; } , 300 ) ; } else btn . style . visibility = "visible" ; } else { btn . style . opacity = "0" ; if ( ! instant ) { setTimeout ( function removeThis ( ) { btn . style . visibility = "none" ; } , 300 ) ; } else btn . style . visibility = "none" ; } return false ; }
instant: make the tog instant, to avoid bugs, optional
instant : make the tog instant to avoid bugs optional
// Return false if the name is not an string in order to avoid console errors // If instant wasn't declared as bool, then make it false // Get the button, if it does not exist then return false // SHOW IT // Make it appear in 0.3s // Make it appear instantly // HIDE IT // Make it dissapear in 0.3s // Make it dissapear instantly