12 lines
393 B
JavaScript
12 lines
393 B
JavaScript
function equip_hat(t, hat_id, hat_name) {
|
|
const profile_pic_hat = document.getElementById("profile-pic-35-hat");
|
|
function extra_actions(xhr) {
|
|
if (xhr.status == 200) {
|
|
profile_pic_hat.src = `/i/hats/${hat_name}.webp?x=6`
|
|
profile_pic_hat.classList.remove('d-none')
|
|
}
|
|
}
|
|
|
|
postToastSwitch(t, `/equip_hat/${hat_id}`, `equip-${hat_id}`, `unequip-${hat_id}`, `d-none`, extra_actions)
|
|
}
|