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:
parent
c569cbc220
commit
685a6f36d9
5
docs/static/js/carbon.js
vendored
5
docs/static/js/carbon.js
vendored
@ -1,5 +1,8 @@
|
|||||||
(function () {
|
(function () {
|
||||||
function attachAd() {
|
function attachAd() {
|
||||||
|
var wrapper = document.getElementById('sidebar-ads');
|
||||||
|
if (wrapper) {
|
||||||
|
|
||||||
var el = document.createElement('script');
|
var el = document.createElement('script');
|
||||||
el.setAttribute('type', 'text/javascript');
|
el.setAttribute('type', 'text/javascript');
|
||||||
el.setAttribute('id', '_carbonads_js');
|
el.setAttribute('id', '_carbonads_js');
|
||||||
@ -9,10 +12,10 @@
|
|||||||
);
|
);
|
||||||
el.setAttribute('async', 'async');
|
el.setAttribute('async', 'async');
|
||||||
|
|
||||||
var wrapper = document.getElementById('sidebar-ads');
|
|
||||||
wrapper.innerHTML = '';
|
wrapper.innerHTML = '';
|
||||||
wrapper.appendChild(el);
|
wrapper.appendChild(el);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
attachAd();
|
attachAd();
|
||||||
|
Loading…
Reference in New Issue
Block a user