From: Sam Georges Date: Tue, 5 Mar 2013 22:17:07 +0000 (+1100) Subject: Code cleanup X-Git-Tag: v4.0.5~26^2~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1729%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Code cleanup --- 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;