Skip to content

Commit

Permalink
Merge pull request #200 from viosey/fix/disqusclick
Browse files Browse the repository at this point in the history
fix(disqusclick): let disqus_click_to_load button automatically hide
  • Loading branch information
neoFelhz committed Feb 16, 2017
2 parents c425977 + 72adfb2 commit 8ba43c3
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions layout/_widget/disqus_click.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</style>

<!-- add data-ripple attribute -->
<div class="btn1">
<div class="btn_click_load">
<button data-ripple><%= __('post.comments_load_button') %></button>
</div>

Expand All @@ -46,21 +46,19 @@
</script>

<script>
$('html').ready(function() {
$(".btn1").click(function() { //click to load comments
var disqus_config = function () {
this.page.url = '<%- config.url + url_for(path) %>'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document;
var s = d.createElement('script');
s.src = '//<%= theme.comment.shortname %>.disqus.com/embed.js';
s.setAttribute('data-timestamp', + new Date());
(d.head || d.body).appendChild(s);
})();
});
$('.btn_click_load').click(function() { //click to load comments
var disqus_config = function () {
this.page.url = '<%- config.url + url_for(path) %>'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document;
var s = d.createElement('script');
s.src = '//<%= theme.comment.shortname %>.disqus.com/embed.js';
s.setAttribute('data-timestamp', + new Date());
(d.head || d.body).appendChild(s);
})();
$('.btn_click_load').css('display','none');
});
</script>

0 comments on commit 8ba43c3

Please sign in to comment.