From e95d15d584da26bad32cf56da78dad97c9fd57eb Mon Sep 17 00:00:00 2001 From: Simone Date: Sun, 15 Jun 2014 21:51:15 +0100 Subject: [PATCH] Refactoring addSidebarToggler() --- .themes/classic/source/javascripts/octopress.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 218a0a1..faaf3db 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -17,11 +17,7 @@ function addSidebarToggler() { $('#content').append(''); $('.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');