add confirmation to detail editing

This commit is contained in:
flash 2016-09-22 20:00:10 +02:00
parent dc2a475af1
commit f12e4e11b0

View file

@ -6,8 +6,27 @@
<p>Alter the details of your account, leave fields blank to leave them unchanged.</p> <p>Alter the details of your account, leave fields blank to leave them unchanged.</p>
{% endblock %} {% endblock %}
{% block js %}
{{ parent() }}
<script>
function updateSettingsConfirm(form, action) {
var dialogue = new Sakura.Dialogue;
dialogue.Text = "Are you sure?";
dialogue.SetType(Sakura.DialogueType.Confirm);
dialogue.AddCallback(Sakura.DialogueButton.No, function () {
this.Close();
});
dialogue.AddCallback(Sakura.DialogueButton.Yes, function () {
updateSettings(form, action);
this.Close();
});
dialogue.Display();
}
</script>
{% endblock %}
{% block settingsContent %} {% block settingsContent %}
<form enctype="multipart/form-data" method="post" action="javascript:;" onsubmit="updateSettings(this, '{{ route('settings.account.details') }}');"> <form enctype="multipart/form-data" method="post" action="javascript:;" onsubmit="updateSettingsConfirm(this, '{{ route('settings.account.details') }}');">
{% if edit_email %} {% if edit_email %}
<div class="profile-field"> <div class="profile-field">
<div><h2>E-mail address</h2></div> <div><h2>E-mail address</h2></div>