Skip to content

Commit ec086a6

Browse files
authored
Fix double #codefund div
Prevent the creation of a double div with the id codefund
1 parent 4772fff commit ec086a6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
},
1616

1717
injectCodeFundContainer() {
18-
let nav = document.getElementsByClassName('sidebar-nav')
19-
let codefundContainer = document.createElement('div')
20-
codefundContainer.id = 'codefund'
21-
nav[0].insertBefore(codefundContainer, nav[0].firstChild)
22-
18+
if(document.getElementById("codefund") === null){
19+
let nav = document.getElementsByClassName('sidebar-nav');
20+
let codefundContainer = document.createElement('div');
21+
codefundContainer.id = 'codefund';
22+
nav[0].insertBefore(codefundContainer, nav[0].firstChild);
23+
}
24+
2325
if (document.getElementsByClassName('cf-wrapper').length === 0) {
2426
window._codefund && window._codefund.serve();
2527
}

0 commit comments

Comments
 (0)