Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(disqusclick): let disqus_click_to_load button automatically hide #200

Merged
merged 1 commit into from
Feb 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>