]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Address V5 Issue #9910 9911/head
authorKristofer Krause <kris.krause@gmail.com>
Tue, 28 Mar 2017 19:42:36 +0000 (15:42 -0400)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2017 19:42:36 +0000 (15:42 -0400)
Fixes V5 Issue #9910

js/foundation/foundation.topbar.js

index 511d1348aa03e039d0f4c8d78530b6cc76f3703d..5f1c4c428d78192971e0e5ca12becda98e04dc70 100644 (file)
           }
         }
       } else {
-        if (self.is_sticky(topbar, topbar.parent(), settings) && topbar.parent().offset().top==0) {
+        if (self.is_sticky(topbar, topbar.parent(), settings) && topbar.parent().offset().top === 0) {
           topbar.parent().addClass('fixed');
         }
 
     resize : function () {
       var self = this;
       self.S('[' + this.attr_name() + ']').each(function () {
-        var topbar = self.S(this),
-            settings = topbar.data(self.attr_name(true) + '-init');
+        var topbar = self.S(this);
 
         var stickyContainer = topbar.parent('.' + self.settings.sticky_class);
         var stickyOffset;
             }
         }
 
-        if (self.is_sticky(topbar, stickyContainer, settings)) {
+        if (self.is_sticky(topbar, stickyContainer, self.settings)) {
           if (stickyContainer.hasClass('fixed')) {
             // Remove the fixed to allow for correct calculation of the offset.
             stickyContainer.removeClass('fixed');
 
         if (!$dropdown.find('.title.back').length) {
 
-          if (settings.mobile_show_parent_link == true && url) {
+          if (settings.mobile_show_parent_link === true && url) {
             $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5></li><li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="' + url + '">' + $link.html() +'</a></li>');
           } else {
             $titleLi = $('<li class="title back js-generated"><h5><a href="javascript:void(0)"></a></h5>');
           }
 
           // Copy link to subnav
-          if (settings.custom_back_text == true) {
+          if (settings.custom_back_text === true) {
             $('h5>a', $titleLi).html(settings.back_text);
           } else {
             $('h5>a', $titleLi).html('&laquo; ' + $link.html());