forked from rDrama/rDrama
add confirmation for changing houses
parent
4ab2b2ba26
commit
97188519a7
|
@ -82,7 +82,12 @@ for (const element of setting_selects) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
element.addEventListener('change', () => {
|
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}`);
|
postToastReload(element,`/settings/personal?${element.name}=${element.value}`);
|
||||||
else
|
else
|
||||||
postToast(element,`/settings/personal?${element.name}=${element.value}`);
|
postToast(element,`/settings/personal?${element.name}=${element.value}`);
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
<p>Join a house (cost: {{cost}} coins or marseybux).</p>
|
<p>Join a house (cost: {{cost}} coins or marseybux).</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="input-group">
|
<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 %}
|
{% for entry in HOUSES %}
|
||||||
<option value="{{entry}}" {% if v.house.startswith(entry) %} selected {% endif %}>
|
<option value="{{entry}}" {% if v.house.startswith(entry) %} selected {% endif %}>
|
||||||
{{entry}}
|
{{entry}}
|
||||||
|
|
Loading…
Reference in New Issue