aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-05-03 06:52:05 +0000
committerMario <mario@mariovavti.com>2024-05-03 06:52:05 +0000
commit47a86f877172fe6cdc44991c0722550e4190cb95 (patch)
treefab8ddd2a40ca681b2f5f417d12eed3650c8fc62 /view
parent07696d4bd144be03819122bfa2c78cd8aa3d4770 (diff)
downloadvolse-hubzilla-47a86f877172fe6cdc44991c0722550e4190cb95.tar.gz
volse-hubzilla-47a86f877172fe6cdc44991c0722550e4190cb95.tar.bz2
volse-hubzilla-47a86f877172fe6cdc44991c0722550e4190cb95.zip
make sure to always move the recent notification to the top
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 4280284ae..7eca7408e 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1819,18 +1819,19 @@ function toggleAside() {
}
function toast(string, severity) {
+ let id = btoa(string);
let container = document.getElementById('toast-container');
-
- let toast = document.getElementById(btoa(string));
+ let toast = document.getElementById(id);
if (!toast) {
toast = document.createElement('div');
- toast.setAttribute('id', btoa(string));
+ toast.setAttribute('id', id);
toast.innerHTML = '<div class="d-flex"><div class="toast-body">' + string + '</div><button type="button" class="btn-close me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button></div>';
toast.classList.add('toast', 'p-2', 'bg-' + severity + '-subtle', 'text-' + severity + '-emphasis', 'border-' + severity);
- container.prepend(toast);
}
+ container.prepend(toast);
+
let toastInstance = bootstrap.Toast.getOrCreateInstance(toast);
if (severity === 'danger') {