forked from rDrama/rDrama
1
0
Fork 0

add confirmation for changing houses

master
Aevann 2023-06-28 00:56:23 +03:00
parent 4ab2b2ba26
commit 97188519a7
2 changed files with 7 additions and 2 deletions

View File

@ -82,7 +82,12 @@ for (const element of setting_selects) {
continue
}
element.addEventListener('change', () => {
if (element.dataset.reload)
if (element.id == "changing-house") {
if (confirm('Are you sure you want to change houses?')) {
postToastReload(element,`/settings/personal?${element.name}=${element.value}`);
}
}
else if (element.dataset.reload)
postToastReload(element,`/settings/personal?${element.name}=${element.value}`);
else
postToast(element,`/settings/personal?${element.name}=${element.value}`);

View File

@ -100,7 +100,7 @@
<p>Join a house (cost: {{cost}} coins or marseybux).</p>
{% endif %}
<div class="input-group">
<select {% if cost > v.coins + v.marseybux or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control setting_select" form="profile-settings" name="house" data-nonce="{{g.nonce}}" data-reload="1">
<select id="changing-house"{% if cost > v.coins + v.marseybux or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control setting_select" form="profile-settings" name="house" data-nonce="{{g.nonce}}" data-reload="1">
{% for entry in HOUSES %}
<option value="{{entry}}" {% if v.house.startswith(entry) %} selected {% endif %}>
{{entry}}