Permalink
Browse files

refactor: scrolling button 页内跳转按钮优化

Use a simpler way to hide comments button automatically.
优化隐藏评论按钮的逻辑,更简洁,适用性更好。
  • Loading branch information...
MOxFIVE committed Dec 24, 2015
1 parent b676405 commit efacfb4f223701c1563d341c30fd7dff76bff302
Showing with 11 additions and 15 deletions.
  1. +0 −13 layout/_partial/article.ejs
  2. +10 −1 layout/_partial/scrolling-button.ejs
  3. +1 −1 source/css/_partial/main.styl
@@ -89,19 +89,6 @@
</section>
<% } %>
<% if (!index && post.comments){ %>
<style>
#scroll {
display: none;
}
</style>
<div class="scroll" id="scroll-with-comments">
<a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
<a href="#comments" title="查看评论"><i class="fa fa-comments-o"></i></a>
<a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<% } %>
<%- partial('_partial/post-nav-button') %>
<% if (post.fancybox != false){ %>
@@ -1,4 +1,13 @@
<div class="scroll" id="scroll">
<a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
<a href="#comments" title="查看评论"><i class="fa fa-comments-o"></i></a>
<a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
</div>
<script>
$(document).ready(function() {
if ($("#comments").length < 1) {
$("#scroll > a:nth-child(2)").hide();
};
})
</script>
@@ -371,7 +371,7 @@
};
}
#scroll, #scroll-with-comments {
#scroll{
right: 0;
}

0 comments on commit efacfb4

Please sign in to comment.