1
0
mirror of https://github.com/go-task/task.git synced 2025-01-12 04:34:11 +02:00

fix: only attempt to attach ad if sidebar ad container exists

This commit is contained in:
Pete Davison 2023-12-25 22:44:38 +00:00
parent c569cbc220
commit 685a6f36d9
No known key found for this signature in database
GPG Key ID: 2ABFD790DF2521A2

View File

@ -1,17 +1,20 @@
(function () {
function attachAd() {
var el = document.createElement('script');
el.setAttribute('type', 'text/javascript');
el.setAttribute('id', '_carbonads_js');
el.setAttribute(
'src',
'//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev'
);
el.setAttribute('async', 'async');
var wrapper = document.getElementById('sidebar-ads');
wrapper.innerHTML = '';
wrapper.appendChild(el);
if (wrapper) {
var el = document.createElement('script');
el.setAttribute('type', 'text/javascript');
el.setAttribute('id', '_carbonads_js');
el.setAttribute(
'src',
'//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev'
);
el.setAttribute('async', 'async');
wrapper.innerHTML = '';
wrapper.appendChild(el);
}
}
setTimeout(function () {