From 548ec614b1387774d4f99113e01e0210af8c7f75 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Wed, 6 Mar 2013 09:17:07 +1100 Subject: [PATCH] Code cleanup --- js/foundation/foundation.section.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/js/foundation/foundation.section.js b/js/foundation/foundation.section.js index 67ce15204..8fa081720 100644 --- a/js/foundation/foundation.section.js +++ b/js/foundation/foundation.section.js @@ -49,7 +49,6 @@ toggle_active : function (e, self) { var $this = $(this), section = $this.closest('section, .section'), - title = section.find('.title'), content = section.find('.content'), parent = section.closest('[data-section]'), self = Foundation.libs.section; @@ -83,9 +82,6 @@ } section.addClass('active'); - - if (self.is_horizontal(parent)) - content.css({left: title.position().left, top: title.outerHeight()}); } self.settings.callback(); @@ -123,6 +119,10 @@ active_section.css('padding-top', self.outerHeight(active_section.find('.title')) - 1); } self.position_titles($this); + + if (self.is_horizontal($this)) { + self.position_content($this); + } }); }, @@ -171,6 +171,17 @@ } }, + position_content : function (section, off) { + var title = section.find('.title'), + content = section.find('.content'); + + if (typeof off === 'boolean') { + content.attr('style', ''); + } else { + content.css({left: title.position().left, top: title.outerHeight()}); + } + }, + small : function (el) { if (el && this.is_accordion(el)) { return true; -- 2.47.3