Merge pull request 'Toast de confirmacion de pregunta creada' (#10) from toast into main

Reviewed-on: #10
Reviewed-by: jorge <jdavidnunez@gmail.com>
This commit was merged in pull request #10.
This commit is contained in:
2026-09-29 13:04:21 +02:00
2 changed files with 22 additions and 3 deletions
+11 -1
View File
@@ -231,6 +231,8 @@ $("#formCrearPregunta").on("submit", function (e) {
// Volvemos a activar el botón
boton.prop("disabled", false);
boton.text("Crear pregunta");
// Toast exito
mostrarToast()
}
},
@@ -243,4 +245,12 @@ $("#formCrearPregunta").on("submit", function (e) {
boton.text("Crear pregunta");
},
});
});
});
function mostrarToast() {
const toastMensaje = document.getElementById("ToastCrearPregunta");
if (toastMensaje) {
const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastMensaje);
toastBootstrap.show();
}
}
+11 -2
View File
@@ -174,8 +174,17 @@ $avatarUsuario = htmlspecialchars($_SESSION['avatar'] ?? 'img/avatars/defaultPro
</div>
</div>
<!-- TOAST PREGUNTA CREADA -->
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="ToastCrearPregunta" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class=" toast-header" style="background-color: #46178f;">
<h5 class="text-white me-auto bi bi-joystick me-2"> Pregunta Creada</h5>
</div>
<div class="fs-6 toast-body">
La pregunta ha sido creada correctamente
</div>
</div>
</div>
<!-- MODAL CREAR PREGUNTA -->
<div class="modal fade"
id="modalCrearPregunta"