flashflashrevolution / website-issues

Bug reports for the legacy Flash Flash Revolution website.
0 stars 1 forks source link

Unable to View Tournament PA Counts on Mobile #6

Closed Xyr00 closed 4 years ago

Xyr00 commented 4 years ago

Current functionality of the tournament page (http://www.flashflashrevolution.com/tournament/) shows PA via an "Acronym" tag, which is not visible on-hover for mobile users.

In the interim, a proposed solution would be to add an "on-click" event toggle to PA counts so that users (web & mobile) can view PA counts by clicking.

The following code can be added to the tournament page head tag and should do the trick, though if there is a better solution that's fine:

<script type="text/javascript">

document.querySelectorAll('acronym').forEach(item => {
    item.addEventListener('click', event => {
        showPA( item );
    })
})

function showPA( obj ){
    alert(obj.title);
}

function showPA( obj ){
    if(obj.innerHTML == obj.title){
        obj.innerHTML = obj.class;
    }
    else{
        obj.class = obj.innerHTML;
        obj.innerHTML = obj.title;
    }
}

</script>

Working JS Fiddle example of how this functions: https://jsfiddle.net/Xyr0/1fwncyjq/

Xyr00 commented 4 years ago

Issue resolved by Psycast using above code.