js/modules/buttons.js
/** Updates the button-hover information display. */
Updates the button-hover information display.
Updates the button - hover information display .
function updateButtonHoverInfo() {
    var hoverHint = document.querySelector('#hover-hint')
    var hoverHintTitle = document.querySelector('#hover-hint .title')
    var hoverHintDescription = document.querySelector('#hover-hint .description')
    const btnName = hoverHint.dataset.btn
    if (btnName === undefined) {
        return
    }
    var hoverButtons = document.querySelectorAll('.canhover')
    for (var btn of hoverButtons) {
        if (btn.dataset.btn == btnName) {
            if (btn.classList.contains('active')) {
                var title = btn.dataset.title
                var description = btn.dataset.description
                if ((title === undefined) || (description === undefined)) {
                    hoverHint.classList.add('hidden')
                    return
                }
                hoverHintTitle.innerText = title
                hoverHintDescription.innerText = description
                hoverHint.classList.remove('hidden')
            } else {
                hoverHint.classList.add('hidden')
            }
        }
    }
}
function updateButtonHoverInfo ( ) { var hoverHint = document . querySelector ( '#hover-hint' ) var hoverHintTitle = document . querySelector ( '#hover-hint .title' ) var hoverHintDescription = document . querySelector ( '#hover-hint .description' ) const btnName = hoverHint . dataset . btn if ( btnName === undefined ) { return } var hoverButtons = document . querySelectorAll ( '.canhover' ) for ( var btn of hoverButtons ) { if ( btn . dataset . btn == btnName ) { if ( btn . classList . contains ( 'active' ) ) { var title = btn . dataset . title var description = btn . dataset . description if ( ( title === undefined ) || ( description === undefined ) ) { hoverHint . classList . add ( 'hidden' ) return } hoverHintTitle . innerText = title hoverHintDescription . innerText = description hoverHint . classList . remove ( 'hidden' ) } else { hoverHint . classList . add ( 'hidden' ) } } } }
Updates the button-hover information display.
Updates the button - hover information display .