Feature/#7 core logic detect page change and refresh #8

Merged
Serraniel merged 4 commits from feature/#7-core-logic-detect-page-change-and-refresh into develop 2020-07-29 11:16:39 +02:00
Showing only changes of commit 3b145e2d4e - Show all commits

View file

@ -17,15 +17,26 @@ function changeFollowedStarColor(node) {
} }
function changeOwnBorderColor(node) { function changeOwnBorderColor(node) {
// find items -> all const targetTagName = "MD-LIST-ITEM"; // tagName is upper case
let requestItems = node.querySelectorAll("md-list-item");
// change border color if profile link is not "false" let updateFunc = item => {
requestItems.forEach(item => {
let profileLink = item.querySelectorAll("a[href*='/profile/']:not([href='/profile/false'])"); let profileLink = item.querySelectorAll("a[href*='/profile/']:not([href='/profile/false'])");
if (profileLink.length > 0) { if (profileLink.length > 0) {
item.style.borderColor = aniBlue item.style.borderColor = aniBlue
} }
}); }
// are we target tag?
if (node.tagName === targetTagName) {
updateFunc(node);
} else {
// find items -> all
let requestItems = node.querySelectorAll("md-list-item");
// change border color if profile link is not "false"
requestItems.forEach(item => {
updateFunc(item);
});
}
} }