fix: sidebar

This commit is contained in:
shenyu 2020-01-23 14:13:24 +08:00
parent 0fb41a4ce2
commit 8f267514b3
3 changed files with 1 additions and 21 deletions

View File

@ -9,11 +9,7 @@
<%- partial('_partial/totop') %> <%- partial('_partial/totop') %>
</div> </div>
</main> </main>
<% if (theme.toc && is_post()){ %>
<aside class="sidebar"> <aside class="sidebar">
<% } else { %>
<aside class="sidebar">
<% } %>
<%- partial('_partial/sidebar') %> <%- partial('_partial/sidebar') %>
</aside> </aside>
<%- partial('_partial/modal') %> <%- partial('_partial/modal') %>

BIN
source/images/ayer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -176,30 +176,14 @@
// Mobile nav // Mobile nav
var $content = $('.content'), var $content = $('.content'),
$sidebar = $('.sidebar'), $sidebar = $('.sidebar');
isMobileNavAnim = false,
mobileNavAnimDuration = 200;
var startMobileNavAnim = function () {
isMobileNavAnim = true;
};
var stopMobileNavAnim = function () {
setTimeout(function () {
isMobileNavAnim = false;
}, mobileNavAnimDuration);
};
$('.navbar-toggle').on('click', function () { $('.navbar-toggle').on('click', function () {
if (isMobileNavAnim) return;
startMobileNavAnim();
$content.toggleClass('on'); $content.toggleClass('on');
$sidebar.toggleClass('on'); $sidebar.toggleClass('on');
stopMobileNavAnim();
}); });
$($content).on('click', function () { $($content).on('click', function () {
if (isMobileNavAnim || !$content.hasClass('on')) return;
$content.removeClass('on'); $content.removeClass('on');
$sidebar.removeClass('on'); $sidebar.removeClass('on');
}); });