File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
; ( function ( window ) {
2
2
window . DocsifyCodefund = {
3
+ scriptEl : null ,
3
4
create : function ( codefundId ) {
4
5
return function ( hook , vm ) {
5
6
hook . ready ( function ( ) {
6
7
window . DocsifyCodefund . injectCodeFundStyle ( ) ;
7
- window . DocsifyCodefund . injectCodeFundScript ( codefundId ) ;
8
8
} )
9
9
10
10
hook . doneEach ( function ( ) {
11
+ window . DocsifyCodefund . injectCodeFundScript ( codefundId ) ;
11
12
window . DocsifyCodefund . injectCodeFundContainer ( ) ;
12
13
} )
13
14
}
25
26
} ,
26
27
27
28
injectCodeFundScript ( codefundId ) {
29
+ if ( window . DocsifyCodefund . scriptEl ) {
30
+ window . DocsifyCodefund . scriptEl . remove ( )
31
+ }
32
+
28
33
var script = document . createElement ( 'script' )
29
34
script . src = "https://codefund.app/properties/" + codefundId + "/funder.js?template=docsify"
30
35
script . async = "async"
31
36
document . body . appendChild ( script )
37
+ window . DocsifyCodefund . scriptEl = script
32
38
} ,
33
39
34
40
injectCodeFundStyle ( ) {
You can’t perform that action at this time.
0 commit comments