mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-10-14 02:31:58 +00:00
Change the way how the dismiss feature is added to toasts.
This commit is contained in:
@@ -192,8 +192,16 @@
|
||||
entry.parentNode.classList.add("active");
|
||||
}
|
||||
}
|
||||
var toast;
|
||||
var toastActionElement
|
||||
{% for message in get_flashed_messages() %}
|
||||
M.toast({"html": '<span>{{ message }}</span><button class="btn-flat toast-action red-text" data-action="close"><i class="material-icons">close</i></button>'});
|
||||
toast = M.toast({"html": `<span>{{ message }}</span><button class="btn-flat toast-action red-text" data-action="close"><i class="material-icons">close</i></button>`});
|
||||
toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
|
||||
if (toastActionElement) {
|
||||
toastActionElement.addEventListener("click", function() {
|
||||
toast.dismiss();
|
||||
});
|
||||
}
|
||||
{% endfor %}
|
||||
for (toastActionElement of document.querySelectorAll(".toast-action[data-action='close']")) {
|
||||
toastActionElement.addEventListener("click", function(event) {
|
||||
|
Reference in New Issue
Block a user