forked from rDrama/rDrama
use showToast in some areas where we weren't before
parent
3c3950adb0
commit
5f16356d7a
|
@ -1,6 +1,5 @@
|
|||
function poll_vote_no_v() {
|
||||
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
|
||||
bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error')).show();
|
||||
showToast(false, "Only logged-in users can vote!");
|
||||
}
|
||||
|
||||
function expandMarkdown(id,type) {
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
function block_user() {
|
||||
|
||||
var usernameField = document.getElementById("exile-username");
|
||||
|
||||
var isValidUsername = usernameField.checkValidity();
|
||||
|
||||
username = usernameField.value;
|
||||
|
||||
if (isValidUsername) {
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("post", "/settings/block");
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
|
@ -19,11 +14,7 @@ function block_user() {
|
|||
location.reload();
|
||||
}
|
||||
else {
|
||||
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success'));
|
||||
myToast.hide();
|
||||
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-error'));
|
||||
myToast.show();
|
||||
document.getElementById("toast-error-message").textContent = "Error. Please try again later.";
|
||||
showToast(false, "Error, please try again later.");
|
||||
}
|
||||
}
|
||||
xhr.send(f)
|
||||
|
|
Loading…
Reference in New Issue