blob: 6abd69af58d3c6c15d66020a94310ac3dde70394 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module.exports = Ferdi => {
const getMessages = () => {
const indirectElements = document.querySelectorAll('.badge:not(.danger)');
const direct = document.querySelectorAll('.badge.danger').length - 1;
let indirect = -1;
for (let i = 0; i < indirectElements.length; i += 1) {
if (indirectElements[i].innerHTML.length > 0) {
indirect++;
}
}
Ferdi.setBadge(direct, indirect);
};
Ferdi.loop(getMessages);
};
|