#1 Fix for lateloading in the list

This commit is contained in:
Serraniel 2020-04-25 23:23:13 +02:00
parent 604db7a723
commit 5c8a2d45fb
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -1,7 +1,23 @@
const starIcon = "star"; const starIcon = "star";
const scripts = [
changeFollowedStarColor,
changeOwnBorderColor,
]
executeAfterPreload(changeFollowedStarColor); executeAfterPreload(initScripts);
executeAfterPreload(changeOwnBorderColor);
function initScripts() {
// run the scripts
runScripts();
// because of late loading in the request list we have to run the codes each time the list changes
document.querySelector("md-list").addEventListener("DOMNodeInserted", event => runScripts(event), false);
}
function runScripts() {
scripts.forEach(script => script());
console.log("DDS")
}
function changeFollowedStarColor() { function changeFollowedStarColor() {
// find stars // find stars