Aevann 2023-07-30 04:09:24 +03:00
parent 8beb2d7e8e
commit b9afeba454
2 changed files with 12 additions and 4 deletions

View File

@ -36,7 +36,9 @@ if (u_username)
}
play_audio(audio);
document.addEventListener('click', () => {
document.addEventListener('click', (e) => {
if (e.target.id.startsWith("toggle-anthem"))
return
if (audio.paused) play_audio(audio);
}, {once : true});
@ -70,7 +72,9 @@ else
if (!paused)
{
play_audio(audio);
document.addEventListener('click', () => {
document.addEventListener('click', (e) => {
if (e.target.id.startsWith("toggle-anthem"))
return
if (audio.paused) play_audio(audio);
}, {once : true});
}

View File

@ -218,7 +218,9 @@
{% endif %}
{% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %}
<button id="toggle-anthem" type="button" class="btn btn-secondary" data-nonce="{{g.nonce}}" data-onclick="toggle()" {% if v.id == u.id %}style="margin-bottom:0!important;padding:0.3rem 0.75rem!important"{% endif %}><i class="fas fa-music mr-1"></i> Profile Anthem</button>
<button id="toggle-anthem" type="button" class="btn btn-secondary" data-nonce="{{g.nonce}}" data-onclick="toggle()" {% if v.id == u.id %}style="margin-bottom:0!important;padding:0.3rem 0.75rem!important"{% endif %}>
<i id="toggle-anthem-icon" class="fas fa-music mr-1"></i> Profile Anthem
</button>
{% endif %}
{% if v and v.id == u.id %}
@ -472,7 +474,9 @@
{% endif %}
{% if FEATURES['USERS_PROFILE_SONG'] and u.song and v and (v.id == u.id or v.mute and not u.unmutable) %}
<button id="toggle-anthem-mobile" type="button" class="btn btn-secondary" data-nonce="{{g.nonce}}" data-onclick="toggle()" {% if v.id == u.id %}style="margin-bottom:0!important;padding:0.3rem 0.75rem!important"{% endif %}><i class="fas fa-music mr-1"></i> Profile Anthem</button>
<button id="toggle-anthem-mobile" type="button" class="btn btn-secondary" data-nonce="{{g.nonce}}" data-onclick="toggle()" {% if v.id == u.id %}style="margin-bottom:0!important;padding:0.3rem 0.75rem!important"{% endif %}>
<i id="toggle-anthem-mobile-icon" class="fas fa-music mr-1"></i> Profile Anthem
</button>
{% endif %}
{% if v and v.id == u.id %}