]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Code cleanup 1729/head
authorSam Georges <sam@daftspunk.com>
Tue, 5 Mar 2013 22:17:07 +0000 (09:17 +1100)
committerSam Georges <sam@daftspunk.com>
Tue, 5 Mar 2013 22:17:07 +0000 (09:17 +1100)
js/foundation/foundation.section.js

index 67ce15204957e91ed41db334642f2e6b0a43182c..8fa081720e02413e9353cc5b616b53e73acdaf80 100644 (file)
@@ -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();
           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);
+        }
       });
     },
 
       }
     },
 
+    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;