Mostly accessibility stuff (#344)

This commit is contained in:
stairman06
2022-01-20 22:21:13 -06:00
committed by GitHub
parent 98c85441f8
commit 643cd87706
13 changed files with 212 additions and 162 deletions

View File

@@ -79,6 +79,7 @@ export default {
onSmallScreen: false,
windowResizeListenerDebounce: null,
ethicalAdLoad: null,
ethicalAdTries: 0,
}
},
head: {
@@ -165,14 +166,18 @@ export default {
},
refresh_ad() {
if (this.ethical_ads_on) {
this.ethicalAdTries++
clearTimeout(this.ethicalAdLoad)
this.ethicalAdLoad = setTimeout(() => {
if (typeof window.ethicalads === 'undefined') {
console.log('EthicalAds are not loaded yet, retrying...')
this.refresh_ad()
}
ethicalads.load()
}, 100)
if (this.ethicalAdTries <= 5) {
this.ethicalAdLoad = setTimeout(() => {
if (typeof window.ethicalads === 'undefined') {
console.log('EthicalAds are not loaded yet, retrying...')
this.refresh_ad()
}
ethicalads.load()
}, 100)
}
}
},
},