nodebb-theme-harmony
Advanced tools
Comparing version 1.2.74 to 1.2.75
{ | ||
"name": "nodebb-theme-harmony", | ||
"version": "1.2.74", | ||
"version": "1.2.75", | ||
"nbbpm": { | ||
@@ -5,0 +5,0 @@ "compatibility": "^3.7.0" |
@@ -257,18 +257,13 @@ 'use strict'; | ||
['notifications', 'chat'].forEach((type) => { | ||
const countEl = document.querySelector(`[component="${type}/count"]`); | ||
if (!countEl) { | ||
const countEl = $(`nav.sidebar [component="${type}/count"]`).first(); | ||
if (!countEl.length) { | ||
return; | ||
} | ||
const count = parseInt(countEl.innerText, 10); | ||
const count = parseInt(countEl.text(), 10); | ||
if (count > 1) { | ||
const listEls = document.querySelectorAll(`[component="${type}/list"]`); | ||
listEls.forEach((listEl) => { | ||
const placeholder = listEl.querySelector('*'); | ||
if (placeholder) { | ||
for (let x = 0; x < count - 1; x++) { | ||
const cloneEl = placeholder.cloneNode(true); | ||
listEl.insertBefore(cloneEl, placeholder); | ||
} | ||
} | ||
}); | ||
const placeholder = $(`nav.sidebar [component="${type}/list"]`).children().first(); | ||
for (let x = 0; x < count - 1; x++) { | ||
const cloneEl = placeholder.clone(true); | ||
cloneEl.insertAfter(placeholder); | ||
} | ||
} | ||
@@ -275,0 +270,0 @@ }); |
Sorry, the diff of this file is not supported yet
1335903
523