mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
show only one flask fixed message
This commit is contained in:
parent
1aa86da116
commit
3db316490d
3 changed files with 10 additions and 3 deletions
|
|
@ -222,6 +222,15 @@ class FlashMsg {
|
|||
//animate message button if message + never opened
|
||||
window.addEventListener("load", (e) => {
|
||||
if (Number(this.flashCount.textContent) > 0) this.animeBtn();
|
||||
// display only one fixed flash message
|
||||
const flashFixedEls = document.querySelectorAll(
|
||||
"[data-flash-message-fixed]",
|
||||
);
|
||||
if (flashFixedEls.length > 1) {
|
||||
flashFixedEls.forEach((el, i) => {
|
||||
if (i > 0) el.remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
//stop animate if clicked once
|
||||
this.openBtn.addEventListener("click", (e) => {
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@ class ServiceModal {
|
|||
}
|
||||
|
||||
setIsDraft(isDraft, method) {
|
||||
console.log(isDraft, method);
|
||||
const draftVal = isDraft ? "yes" : "no";
|
||||
|
||||
document.querySelectorAll('input[name="is_draft"]').forEach((inp) => {
|
||||
|
|
@ -322,8 +321,6 @@ class ServiceModal {
|
|||
inp.value = draftVal;
|
||||
});
|
||||
|
||||
console.log("f");
|
||||
|
||||
//Update draft button
|
||||
const btn = document.querySelector("button[data-toggle-draft-btn]");
|
||||
|
||||
|
|
|
|||
1
src/ui/templates/base.html
vendored
1
src/ui/templates/base.html
vendored
|
|
@ -49,6 +49,7 @@
|
|||
role="alert"
|
||||
aria-description="login message alert"
|
||||
data-flash-message
|
||||
data-flash-message-fixed
|
||||
class="{% if category == 'error' %} bg-red-500 {%else%} bg-green-500 {%endif %} p-4 mb-1 md:mb-3 md:mr-3 z-[1001] flex flex-col fixed bottom-0 right-0 w-full md:w-1/2 max-w-[300px] min-h-20 my-2 border rounded-lg hover:scale-102 transition shadow-md break-words dark:brightness-90"
|
||||
>
|
||||
<div class="flex justify-between align-top items-start">
|
||||
|
|
|
|||
Loading…
Reference in a new issue