Skip to content

Commit

Permalink
Revert "Merge branch 'patternlab/DP-17200-add-horizontal-nav-code-bra…
Browse files Browse the repository at this point in the history
…nch' into patternlab/DP-19337_log-in-to-component"

This reverts commit efcb159, reversing
changes made to 330b49d.
  • Loading branch information
ygannett committed Jul 21, 2020
1 parent 085bb3b commit b3a7518
Show file tree
Hide file tree
Showing 189 changed files with 103 additions and 114 deletions.
16 changes: 0 additions & 16 deletions changelogs/DP-19335.yml

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ menuButton.addEventListener("click", function (event) {
subItems.style.opacity = "0";

setTimeout(function timeoutFunction() {
subMenu.classList.add("is-closed");
subMenu.classList.add("is-closed");

}, 500);
}
}, 230);
Expand Down Expand Up @@ -271,9 +272,7 @@ function closeMenuJumpToSearch() {
function commonCloseMenuTasks() {
body.classList.remove("show-menu");

menuButtonText[0].textContent = "Menu";
menuButtonText[1].textContent = "Mass.gov";

menuButtonText.textContent = "Menu";
menuButton.setAttribute("aria-expanded", "false");
menuButton.setAttribute("aria-label", "Open the main menu for mass.gov");

Expand All @@ -299,10 +298,7 @@ function openMenuJumpToSearch() {
function commonOpenMenuTasks() {
body.classList.add("show-menu");

for (let i = 0; i < menuButtonText.length; i++) {
menuButtonText[i].textContent = "Close";
}

menuButtonText.textContent = "Close";
menuButton.setAttribute("aria-expanded", "true");
menuButton.setAttribute("aria-label", "Close the main menu for mass.gov");
if (feedbackButton) {
Expand All @@ -327,6 +323,7 @@ function closeSubMenus(item) {
}

for (let i = 0; i < siblings.length; i++) {

if (siblings[i].classList.contains("submenu-open")) {

siblings[i].classList.remove("submenu-open");
Expand Down Expand Up @@ -488,7 +485,6 @@ function closeNarrowUtilContent() {

utilNarrowContent.style.maxHeight = "0";
utilNarrowContainer.style.opacity = "0";

setTimeout(function timeoutFunction() {
utilNarrowContent.classList.add("is-closed");
}, 500);
Expand Down
11 changes: 10 additions & 1 deletion patternlab/styleguide/source/assets/js/modules/mainNavMixed.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
const body = document.querySelector("body");
let width = document.documentElement.clientWidth;
const menuButton = document.querySelector(".js-header-menu-button");
// let menuButtonText = document.querySelector(".js-header__menu-text");
// let buttonLabel;
// const hamburgerMenuContainer = document.querySelector(".ma__header__hamburger__nav-container");
// const feedbackButton = document.querySelector(".ma__fixed-feedback-button");
// let menuItems = document.querySelectorAll(".js-main-nav-hamburger-toggle");
const menuOverlay = document.querySelector(".menu-overlay");
// let utilNavWide = document.querySelector(".js-utility-nav--wide");
// const jumpToSearchButton = document.querySelector(".js-header-search-access-button");
// const hamburgerSearchInput = document.getElementById("nav-search");

// Hide hamburger menu when window size is resized to over 840 while hamburger menu is open.
window.addEventListener("resize", hideHamburgerMenu);

function hideHamburgerMenu () {
if (width > 840) {
// alert(width);
if (body.classList.contains("show-menu")) {
body.classList.remove("show-menu");
menuButton.setAttribute("aria-expanded", "false");
menuButton.setAttribute("aria-label", "Open the main menu for mass.gov");
menuOverlay.classList.remove("overlay-open");
}
}
}
}
176 changes: 88 additions & 88 deletions patternlab/styleguide/source/assets/js/modules/utilNav.js
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
export default (function (window, document, $, undefined) {

let $panels = $('.js-util-nav-content');
let $panel = "";
let $utilityButtons = $('.js-util-nav-toggle');

$panels.each(function () {
if ($(this).closeset(".ma__header__hamburger__utility-nav--narrow ") !== true) {
$panel = $(this);
}
const height = $panel.height();
const $closeButton = $panel.find('.js-close-util-nav');

$panel.css('top', '-' + height + 'px');
$(window).on('resized', function () {
if ($(window).width() > 840) {
$panel.css('top', '-' + height + 'px');
}
else {
$panel.removeAttr('style')
}
});

$closeButton.on('click', function () {
$panel.css('top', '-' + height + 'px');
$panel.toggleClass('is-closed');
$panel.attr("aria-hidden", "true");
});

$panel.on('keydown', function (e) {
if (e.key == "Escape") {
$panel.css('top', '-' + height + 'px');
$panel.toggleClass('is-closed');
$panel.attr("aria-hidden", "true");
}
});
});

$utilityButtons.each(function () {
const $thisButton = $(this);
let $thisPanel = $thisButton.next('.js-util-nav-content');
const $closePanel = $thisPanel.find('.js-close-util-nav');

$thisButton.on('click', function () {
if ($thisButton.closest(".ma__header__hamburger__utility-nav--narrow")) {
$thisPanel = null;
}
else {
$thisPanel.removeClass('is-closed');
$thisPanel.removeAttr('style');
$thisPanel.attr("aria-hidden", "false");
}

$('body').addClass('show-submenu');

// Only affects utility nav on the utility nav bar with the hamburger menu.
if ($(this).closest(".ma__header__hamburger__utility-nav--wide")) {
if ($thisPanel.hasClass("is-closed")) {
$(this).closest(".ma__header__hamburger__nav").removeClass("util-nav-content-open");
}
else {
$(this).closest(".ma__header__hamburger__nav").addClass("util-nav-content-open");
}
}

setTimeout(function () {
$closePanel.focus();
}, 250);

});
});

$('.js-close-sub-nav').on('click', function () {
$('.js-util-nav-content').addClass('is-closed');
$('.js-util-nav-content').removeAttr('style');
$('body').removeClass('show-submenu');
});

// debouncer
var resize_timeout;
$(window).on('resize orientationchange', function () {
clearTimeout(resize_timeout);

resize_timeout = setTimeout(function () {
$(window).trigger('resized');
}, 150);
});
})(window, document, jQuery);
export default (function (window, document, $, undefined) {

let $panels = $('.js-util-nav-content');
let $panel = "";
let $utilityButtons = $('.js-util-nav-toggle');

$panels.each(function () {
if ($(this).closeset(".ma__header__hamburger__utility-nav--narrow ") !== true) {
$panel = $(this);
}
const height = $panel.height();
const $closeButton = $panel.find('.js-close-util-nav');

$panel.css('top', '-' + height + 'px');
$(window).on('resized', function () {
if ($(window).width() > 840) {
$panel.css('top', '-' + height + 'px');
}
else {
$panel.removeAttr('style')
}
});

$closeButton.on('click', function () {
$panel.css('top', '-' + height + 'px');
$panel.toggleClass('is-closed');
$panel.attr("aria-hidden", "true");
});

$panel.on('keydown', function (e) {
if (e.key == "Escape") {
$panel.css('top', '-' + height + 'px');
$panel.toggleClass('is-closed');
$panel.attr("aria-hidden", "true");
}
});
});

$utilityButtons.each(function () {
const $thisButton = $(this);
let $thisPanel = $thisButton.next('.js-util-nav-content');
const $closePanel = $thisPanel.find('.js-close-util-nav');

$thisButton.on('click', function () {
if ($thisButton.closest(".ma__header__hamburger__utility-nav--narrow")) {
$thisPanel = null;
}
else {
$thisPanel.removeClass('is-closed');
$thisPanel.removeAttr('style');
$thisPanel.attr("aria-hidden", "false");
}

$('body').addClass('show-submenu');

// Only affects utility nav on the utility nav bar with the hamburger menu.
if ($(this).closest(".ma__header__hamburger__utility-nav--wide")) {
if ($thisPanel.hasClass("is-closed")) {
$(this).closest(".ma__header__hamburger__nav").removeClass("util-nav-content-open");
}
else {
$(this).closest(".ma__header__hamburger__nav").addClass("util-nav-content-open");
}
}

setTimeout(function () {
$closePanel.focus();
}, 250);

});
});

$('.js-close-sub-nav').on('click', function () {
$('.js-util-nav-content').addClass('is-closed');
$('.js-util-nav-content').removeAttr('style');
$('body').removeClass('show-submenu');
});

// debouncer
var resize_timeout;
$(window).on('resize orientationchange', function () {
clearTimeout(resize_timeout);

resize_timeout = setTimeout(function () {
$(window).trigger('resized');
}, 150);
});
})(window, document, jQuery);

0 comments on commit b3a7518

Please sign in to comment.