Skip to content

Commit

Permalink
Revert "Fixed scroll issue for iOS and hopefully didn't break other d…
Browse files Browse the repository at this point in the history
…evices - DP-20209"

This reverts commit 40dc92b.
  • Loading branch information
tom-fleming committed Oct 15, 2020
1 parent f4a5693 commit c9592a8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions patternlab/styleguide/source/assets/js/modules/mainNavHamburger.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ let hamburgerMenuAlertScrolling = function() {
let alertHeight = document.querySelector(".ma__emergency-alerts").clientHeight || 0;
let hamburgerMenuTop = document.querySelector(".ma__header__hamburger__nav-container").offsetTop || 0;
let paddingTarget = hamburgerMainNav;
paddingTarget.style.paddingBottom = alertHeight + hamburgerMenuTop + "px";

if (utilNavNarrowCheck() !== false) {
paddingTarget = utilNarrowNav;
if (width < 841) {
paddingTarget.style.paddingBottom = "80px";
}
hamburgerMainNav.style.paddingBottom = 0;
}
else {
// Add bottom padding when function is initially called.
paddingTarget.style.paddingBottom = alertHeight + hamburgerMenuTop + "px";
}

// Add bottom padding when alert style changes occur.
const alertObserver = new MutationObserver(function(mutations) {
Expand All @@ -47,7 +58,6 @@ let hamburgerMenuAlertScrolling = function() {
}
if (utilNavNarrowCheck() !== false) {
paddingTarget = utilNarrowNav;

hamburgerMainNav.style.paddingBottom = 0;
}

Expand All @@ -56,6 +66,9 @@ let hamburgerMenuAlertScrolling = function() {
if (currentDisplayValue === oldDisplayValue) {
alertHeight = document.querySelector(".ma__emergency-alerts").clientHeight;
paddingTarget.style.paddingBottom = alertHeight + hamburgerMenuTop + "px";
if (width < 841) {
paddingTarget.style.paddingBottom = "80px";
}
}
}
});
Expand Down

0 comments on commit c9592a8

Please sign in to comment.