Skip to content

Commit 3c0f927

Browse files
author
Pooya Parsa
committed
Fixed problem with disqus bootstrap-vue#71
1 parent 5233f5f commit 3c0f927

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

docs/layouts/docs.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,25 @@
5858
methods: {
5959
editPage(){
6060
window.open(this.github, '_blank');
61-
this.$ga.event('docs','edit_page');
61+
this.$ga.event('docs', 'edit_page');
6262
},
6363
issue(){
6464
window.open('https://github.com/bootstrap-vue/bootstrap-vue/issues/new', '_blank');
65-
this.$ga.event('docs','open_issue');
65+
this.$ga.event('docs', 'open_issue');
6666
},
6767
},
6868
mounted(){
69-
7069
if (!document.disqus) {
71-
let script = document.createElement('script');
72-
script.src = '//bootstrap-vue.disqus.com/embed.js';
73-
script.setAttribute('data-timestamp', +new Date());
74-
document.getElementById('disqus_script').appendChild(script);
75-
document.disqus = true;
70+
let disqus_script = document.getElementById('disqus_script');
71+
if (disqus_script) {
72+
let script = document.createElement('script');
73+
script.src = '//bootstrap-vue.disqus.com/embed.js';
74+
script.setAttribute('data-timestamp', +new Date());
75+
disqus_script.appendChild(script);
76+
document.disqus = true;
77+
}
7678
} else {
77-
DISQUS.reset({reload: true});
79+
if (DISQUS) DISQUS.reset({reload: true});
7880
}
7981
}
8082
}

0 commit comments

Comments
 (0)