From 60c98c77f857bdaef9c11ef0e0d7e9e73dec49ec Mon Sep 17 00:00:00 2001 From: Guillaume Lafarge Date: Thu, 5 Jun 2014 14:52:37 +0200 Subject: [PATCH] data-options fix Some options aren't correctly parsed in `data-options` attribute. I think this should fix the issue. --- js/foundation/foundation.magellan.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/foundation/foundation.magellan.js b/js/foundation/foundation.magellan.js index 32ce5d07d..2187067f5 100644 --- a/js/foundation/foundation.magellan.js +++ b/js/foundation/foundation.magellan.js @@ -71,11 +71,12 @@ var self = this; $('[' + this.attr_name() + '=fixed]', self.scope).each(function(idx, el) { var expedition = $(this), + settings = expedition.data('magellan-expedition-init'), styles = expedition.attr('styles'), // save styles top_offset; expedition.attr('style', ''); - top_offset = expedition.offset().top + self.settings.threshold; + top_offset = expedition.offset().top + settings.threshold; expedition.data(self.data_attr('magellan-top-offset'), top_offset); expedition.attr('style', styles); @@ -88,6 +89,7 @@ $('[' + this.attr_name() + '=fixed]', self.scope).each(function() { var expedition = $(this), + settings = expedition.data('magellan-expedition-init'), top_offset = expedition.data('magellan-top-offset'); if (window_top_offset >= top_offset) { @@ -100,7 +102,7 @@ placeholder.attr(self.add_namespace('data-magellan-expedition-clone'),''); expedition.before(placeholder); } - expedition.css({position:'fixed', top: self.settings.fixed_top}); + expedition.css({position:'fixed', top: settings.fixed_top}); } else { expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove(); expedition.attr('style','').removeClass('fixed'); -- 2.47.2