Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erreur d'affichage d'un toastMessage quand la navbar est verticale #1234

Open
VeveQNV opened this issue Dec 28, 2024 · 1 comment
Open

Erreur d'affichage d'un toastMessage quand la navbar est verticale #1234

VeveQNV opened this issue Dec 28, 2024 · 1 comment

Comments

@VeveQNV
Copy link
Contributor

VeveQNV commented Dec 28, 2024

Description

quand la navbar est verticale l'affichage des toastmessages dysfonctionne du fait que le message est positionné en dessous de la navbar : en mode vertical, le dessous de la navbar est en dehors de la fenetre. Il faudrait positionner le message par rapport au top de la fenetre.

@VeveQNV
Copy link
Contributor Author

VeveQNV commented Dec 28, 2024

pour contourner le probleme, j'ai rajouté dans le répertoire custom/javascripts un fichier js contenant le code suivant :

function toastMessage(
message,
duration = 3000,
toastClass = "alert alert-secondary-1",
) {
const $toast = $(
<div class="toast-message"><div class="${toastClass}">${message}</div></div>,
);
$("body").after($toast);
$toast.css("top", 20px);
$toast.css("opacity", 1);
setTimeout(() => {
$toast.css("opacity", 0);
}, duration);
setTimeout(() => {
$toast.remove();
}, duration + 300);
$toast.addClass("visible");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant