From b0a610095fd80f51c21ff49ddbe7aa98ea434ebc Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 13 Jul 2011 11:57:44 -0400 Subject: fixed sidebar columnization --- .themes/classic/source/javascripts/octopress.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to '.themes/classic/source') diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index c26a21f3..949f7a03 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -21,14 +21,16 @@ function addSidebarToggler() { } }); sections = $('aside[role=sidebar] > section') + if(sections.length > 1){ + sections.each(function(section, index){ + if ((sections.length >= 3) && index % 3 == 0) { + $(section).addClass("first"); + } + count = ((index +1) % 2) ? "odd" : "even"; + $(section).addClass(count); + }); + } if(sections.length >= 3){ $('aside[role=sidebar]').addClass('thirds') } - sections.each(function(section, index){ - if ((sections.length >= 3) && index % 3 == 0) { - $(section).addClass("first"); - } - count = ((index +1) % 2) ? "odd" : "even"; - $(section).addClass(count); - }); } function testFeatures() { var features = ['maskImage']; -- cgit v1.2.1