js/foundation/foundation.topbar.js in zurb-foundation-4.2.1 vs js/foundation/foundation.topbar.js in zurb-foundation-4.2.2

- old
+ new

@@ -4,11 +4,11 @@ 'use strict'; Foundation.libs.topbar = { name : 'topbar', - version : '4.2.0', + version : '4.2.2', settings : { index : 0, stickyClass : 'sticky', custom_back_text: true, @@ -26,11 +26,11 @@ $.extend(true, this.settings, method); } else if (typeof options !== 'undefined') { $.extend(true, this.settings, options); } - if (typeof method != 'string') { + if (typeof method !== 'string') { $('.top-bar, [data-topbar]').each(function () { $.extend(true, self.settings, self.data_options($(this))); self.settings.$w = $(window); self.settings.$topbar = $(this); @@ -84,11 +84,11 @@ section.find('li.moved').removeClass('moved'); topbar.data('index', 0); topbar .toggleClass('expanded') - .css('min-height', ''); + .css('max-height', ''); } if (!topbar.hasClass('expanded')) { if (topbar.hasClass('fixed')) { topbar.parent().addClass('fixed'); @@ -162,18 +162,18 @@ } else { section.css({right: -(100 * topbar.data('index')) + '%'}); section.find('>.name').css({right: 100 * topbar.data('index') + '%'}); } - topbar.css('min-height', self.height($this.siblings('ul')) + self.outerHeight(titlebar, true)); + topbar.css('max-height', self.height($this.siblings('ul')) + self.outerHeight(titlebar, true)); } }); $(window).on('resize.fndtn.topbar', function () { if (!self.breakpoint()) { $('.top-bar, [data-topbar]') - .css('min-height', '') + .css('max-height', '') .removeClass('expanded') .find('li') .removeClass('hover'); } }.bind(this)); @@ -208,22 +208,22 @@ section.css({right: -(100 * topbar.data('index')) + '%'}); section.find('>.name').css({right: 100 * topbar.data('index') + '%'}); } if (topbar.data('index') === 0) { - topbar.css('min-height', 0); + topbar.css('max-height', ''); } else { - topbar.css('min-height', self.height($previousLevelUl) + self.outerHeight(titlebar, true)); + topbar.css('max-height', self.height($previousLevelUl) + self.outerHeight(titlebar, true)); } setTimeout(function () { $movedLi.removeClass('moved'); }, 300); }); }, breakpoint : function () { - return $(window).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9'); + return $(document).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9'); }, assemble : function () { var self = this; // Pull element out of the DOM for manipulation