mirror of
https://hk.gh-proxy.com/https://github.com/NodeBB/nodebb-theme-harmony.git
synced 2025-10-03 05:01:05 +08:00
fix: update notif placeholder code to handle both dropdowns
This commit is contained in:
parent
22dc1795cf
commit
a151430d96
1 changed files with 8 additions and 6 deletions
|
@ -236,13 +236,15 @@ $(document).ready(function () {
|
|||
function fixPlaceholders() {
|
||||
const count = parseInt(document.querySelector('[component="notifications/count"]').innerText, 10);
|
||||
if (count > 1) {
|
||||
const notifListEl = document.querySelector('[component="notifications/list"]');
|
||||
const placeholder = notifListEl.querySelector('li');
|
||||
const notifListEls = document.querySelectorAll('[component="notifications/list"]');
|
||||
notifListEls.forEach((notifListEl) => {
|
||||
const placeholder = notifListEl.querySelector('li');
|
||||
|
||||
for (let x = 0; x < count - 1; x++) {
|
||||
const cloneEl = placeholder.cloneNode(true);
|
||||
notifListEl.insertBefore(cloneEl, placeholder);
|
||||
}
|
||||
for (let x = 0; x < count - 1; x++) {
|
||||
const cloneEl = placeholder.cloneNode(true);
|
||||
notifListEl.insertBefore(cloneEl, placeholder);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue