diff options
author | Simone <hello@simonewebdesign.it> | 2014-06-15 21:51:15 +0100 |
---|---|---|
committer | Simone <hello@simonewebdesign.it> | 2014-06-15 21:51:15 +0100 |
commit | e95d15d584da26bad32cf56da78dad97c9fd57eb (patch) | |
tree | 7ec4bc92d8f9f7f73d4d12178ad3bc45ebcb6534 | |
parent | 9bc4bb02ee3318d07b6b1ecd838a09461eff627b (diff) | |
download | my_new_personal_website-e95d15d584da26bad32cf56da78dad97c9fd57eb.tar.xz my_new_personal_website-e95d15d584da26bad32cf56da78dad97c9fd57eb.zip |
Refactoring addSidebarToggler()
Diffstat (limited to '')
-rw-r--r-- | .themes/classic/source/javascripts/octopress.js | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 218a0a1a..faaf3dbe 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -17,11 +17,7 @@ function addSidebarToggler() { $('#content').append('<span class="toggle-sidebar"></span>'); $('.toggle-sidebar').bind('click', function(e) { e.preventDefault(); - if ($('body').hasClass('collapse-sidebar')) { - $('body').removeClass('collapse-sidebar'); - } else { - $('body').addClass('collapse-sidebar'); - } + $('body').toggleClass('collapse-sidebar'); }); } var sections = $('aside.sidebar > section'); |