</ul>
</div>
</section>
+ <section class="section">
+ <p class="title"><a href="#">Section 3</a></p>
+ <div class="content">
+ <ul class="side-nav">
+ <li><a href="#">Link 2</a></li>
+ <li><a href="#">Link 2</a></li>
+ <li><a href="#">Link 3</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Link 1</a></li>
+ </ul>
+ </div>
+ </section>
+ <section class="section">
+ <p class="title"><a href="#">Section 4</a></p>
+ <div class="content">
+ <ul class="side-nav">
+ <li><a href="#">Link 2</a></li>
+ <li><a href="#">Link 2</a></li>
+ <li><a href="#">Link 3</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Link 1</a></li>
+ </ul>
+ </div>
+ </section>
</div>
<div class="section-container auto" data-section data-options="deep_linking: true;">
<section class="section">
Foundation.libs.section = {
name: 'section',
- version : '4.0.9',
+ version : '4.1.0',
settings : {
deep_linking: false,
init : function (scope, method, options) {
var self = this;
-
- this.scope = scope || this.scope;
- Foundation.inherit(this, 'throttle data_options');
+ Foundation.inherit(this, 'throttle data_options position_right offset_right');
+ console.log(this)
if (typeof method != 'string') {
this.set_active_from_hash();
} else {
titles.each(function () {
- $(this).css('left', previous_width);
+ if (!self.rtl) {
+ $(this).css('left', previous_width);
+ } else {
+ $(this).css('right', previous_width);
+ }
previous_width += self.outerWidth($(this));
});
}
section.find('section, .section').each(function () {
var title = $(this).find('.title'),
content = $(this).find('.content');
-
- content.css({left: title.position().left - 1, top: self.outerHeight(title) - 2});
+ if (!self.rtl) {
+ content.css({left: title.position().left - 1, top: self.outerHeight(title) - 2});
+ } else {
+ content.css({right: self.position_right(title) + 1, top: self.outerHeight(title) - 2});
+ }
});
// temporary work around for Zepto outerheight calculation issues.
},
+ position_right : function (el) {
+ var section = el.closest('[data-section]'),
+ section_width = el.closest('[data-section]').width(),
+ offset = section.find('.title').length;
+ return (section_width - el.position().left - el.width() * (el.index() + 1) - offset);
+ },
+
small : function (el) {
var settings = $.extend({}, this.settings, this.data_options(el));
if (this.is_tabs(el)) {