do not ask for confirmation when enable/disable alias

This commit is contained in:
Son NK 2020-04-24 09:47:25 +02:00
parent ba105f076e
commit 7d35baddd4

View file

@ -379,26 +379,7 @@
});
$(".custom-switch-input").change(function (e) {
var message = "";
let alias = $(this).parent().find(".alias").val();
if (e.target.checked) {
message = `After this, you will start receiving email sent to <b>${alias}</b>, please confirm.`;
} else {
message = `After this, you will stop receiving email sent to <b>${alias}</b>, please confirm.`;
}
notie.confirm({
text: message,
cancelCallback: () => {
// reset to the original value
var oldValue = !$(this).prop("checked");
$(this).prop("checked", oldValue);
},
submitCallback: () => {
$(this).closest("form").submit();
}
});
$(this).closest("form").submit();
})
</script>
{% endblock %}