]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
data-options fix 5270/head
authorGuillaume Lafarge <contact@guillaumelafarge.fr>
Thu, 5 Jun 2014 12:52:37 +0000 (14:52 +0200)
committerGuillaume Lafarge <contact@guillaumelafarge.fr>
Thu, 5 Jun 2014 12:52:37 +0000 (14:52 +0200)
Some options aren't correctly parsed in `data-options` attribute. I think this should fix the issue.

js/foundation/foundation.magellan.js

index 32ce5d07dbc58602783be12f9812354917e2c8fe..2187067f566177673871cb8cd3ef37e39b000883 100644 (file)
       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) {
             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');