Skip to content

Commit

Permalink
Merge pull request #5270 from glafarge/patch-3
Browse files Browse the repository at this point in the history
data-options fix
  • Loading branch information
thedeerchild committed Jun 11, 2014
2 parents 634ff5f + 60c98c7 commit 4f313c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/foundation/foundation.magellan.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -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');
Expand Down

0 comments on commit 4f313c7

Please sign in to comment.