Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5caf474
restructure org nav data and template
clairesunstudio Jun 30, 2023
7ed1162
cleanup unused js
clairesunstudio Jun 30, 2023
b599636
match styles
clairesunstudio Jul 5, 2023
59817af
cleanup unused
clairesunstudio Jul 5, 2023
83af008
change I want to... to Actions & Services
clairesunstudio Jul 5, 2023
fac57b4
add id prop to heading
clairesunstudio Jul 5, 2023
830eeb9
add id and href data
clairesunstudio Jul 5, 2023
46dbc5e
add scrolling effect
clairesunstudio Jul 5, 2023
64ee56b
remove mobile toggle label pseudo classes
clairesunstudio Jul 5, 2023
2c849cb
fix and cleanup css
clairesunstudio Jul 5, 2023
5f40c33
remove test data
clairesunstudio Jul 5, 2023
6f3f114
fix classname typo and update orgnav screen reader labels
clairesunstudio Jul 5, 2023
91bf126
reorder nav
clairesunstudio Jul 5, 2023
c450c1b
remove menubar roles
clairesunstudio Jul 6, 2023
6c46b4b
fix mobile toggle button styles
clairesunstudio Jul 6, 2023
238d561
cleanup deplicating class in css
clairesunstudio Jul 6, 2023
6c10d4d
add changelog
clairesunstudio Jul 6, 2023
1d7efb1
add focus trapping for mobile modal
clairesunstudio Jul 6, 2023
82a80b3
add aria attributes
clairesunstudio Jul 6, 2023
8afd0bc
add aria-expanded and aria-label to mobile
clairesunstudio Jul 6, 2023
6064d22
code cleanup
clairesunstudio Jul 6, 2023
edc6179
add changelog
clairesunstudio Jul 6, 2023
e4e4096
Merge branch 'develop' into patternlab/DP-28670-simplify-subnav
clairesunstudio Jul 6, 2023
a884c86
remove unused data and add documentation
clairesunstudio Jul 6, 2023
e57c6b5
Merge branch 'patternlab/DP-28670-simplify-subnav' of github.com:mass…
clairesunstudio Jul 6, 2023
707a1f1
remove unused
clairesunstudio Jul 6, 2023
4970fac
set var
clairesunstudio Jul 10, 2023
d537dd5
pass data into organizationNavigation.js
clairesunstudio Jul 10, 2023
99cc68c
cleanup unsed styles
clairesunstudio Jul 10, 2023
bdaaea9
cleanup unsed styles
clairesunstudio Jul 10, 2023
34d5385
Merge branch 'patternlab/DP-28670-simplify-subnav' into patternlab/DP…
clairesunstudio Jul 10, 2023
8b53db4
add observer to add active class
clairesunstudio Jul 10, 2023
e8a7886
add styles to active class
clairesunstudio Jul 10, 2023
fb025cc
fix styles
clairesunstudio Jul 10, 2023
211b0aa
Merge branch 'develop' into patternlab/DP-28670-simplify-subnav
arthurbaghdas Jul 17, 2023
e81020d
Merge branch 'develop' into patternlab/DP-28670-simplify-subnav
arthurbaghdas Sep 11, 2023
7ffbf0b
Add id for the colored heading
arthurbaghdas Sep 11, 2023
36cf94c
Add id for the colored heading
arthurbaghdas Sep 11, 2023
cc42b04
Merge branch 'patternlab/DP-28670-simplify-subnav' into patternlab/DP…
tom-fleming Sep 18, 2023
782b0ea
resolve merge conflicts
clairesunstudio Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions changelogs/DP-28670.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Changed:
- project: Patternlab
component: Heading1,Heading2,Heading3,Heading4,Heading5,Heading6
description: Add `id` prop. (#1819)
issue: DP-28670
impact: Minor
- project: Patternlab
component: OrganizationNavigation
description: Only allow jump links in organization nav, add `id` to each section to become jump link anchors. (#1819)
issue: DP-28670
impact: Minor
Removed:
- project: Patternlab
component: OrgNavContactMenu,OrgNavContactRow,OrgNavIWantToMenu
description: Removed deprecated subcomponents used in the OrganizationNavigation. (#1819)
issue: DP-28670
impact: Minor
Fixed:
- project: Patternlab
component: OrganizationNavigation
description: Improve desktop and mobile keyboard and screen reader user experience. Label elements correctly and concisely, make interactive elements keyboard accessible and announce the state to screen readers. (#1819)
issue: DP-28670
impact: Patch
- project: Assets, React
component: FilterBox
description: Fixed `.ma__visually-hidden` typo. (#1819)
issue: DP-28670
impact: Patch
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
text-align: left;
border: 0;
background-color: transparent;
padding: 1rem 0;
padding: 1rem;
font-weight: $fonts-bold;
font-size: $fonts-xsmall;
color: $c-font-base;
Expand All @@ -48,6 +48,11 @@
height: 100%;
font-size: $fonts-smaller;
}

&.orgNav-active {
background-color: $c-primary-alt;
color: $c-white;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ $menu-transition-time: 0.3s;
}

&__mobile-toggle {

@include ma-button-reset;

@include ma-container;
margin-left: 0;
margin-right: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Make eventListing data object available in eventListing module js.
var ma = ma || {};
ma.eventListingInteractive = ma.eventListingInteractive || [];
ma.eventListingInteractive.push({{ eventListingInteractive|json_encode|raw }}{# raw is necessary to prevent rendering ascii characters. #});
ma.eventListingInteractive.push({{ eventListingInteractive|json_encode|raw }});
</script>


Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@
{% endif %}
</div>
</nav>

<script>
// Make organizationNavigation data object available in leaflet map module js.
var ma = ma || {};
ma.orgNav = ma.orgNav || [];
ma.orgNav.push({{ organizationNavigation|json_encode()|raw }});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ma.orgNav.push({{ organizationNavigation|json_encode()|raw }});
ma.orgNav.push({{ organizationNavigation|json_encode|raw }});

</script>
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default (function (window, document, $, undefined) {
}
} else {
$this.attr('aria-expanded', false);
// when menu is closed, put it back to its original location.
// when menu is closed, put it back to its original location.
stickyOnScroll();
}

Expand Down Expand Up @@ -115,6 +115,42 @@ export default (function (window, document, $, undefined) {
feedbackButton.show();
}
});

const orgNavRaw = ma.orgNav[0].orgNav;
console.log(orgNavRaw);

let callback = (entries) => {
entries.forEach(entry => {
const targetDiv = document.querySelector(`[href="#${entry.target.id}"]`);
if (entry.isIntersecting) targetDiv.classList.add('orgNav-active')
const active = [...document.querySelectorAll('.orgNav-active')];
if (active.length > 1) active[dir === 1 ? 1 : 0].classList.remove("orgNav-active")
});
};

const observer = new IntersectionObserver(callback);
orgNavRaw.forEach((el) => {
const orgNavTarget = document.getElementById(el.id);
observer.observe(orgNavTarget)
});

let dir = 0
window.onscroll = function(e) {
// print "false" if direction is down and "true" if up
dir = this.oldScroll > this.scrollY ? 1 : -1;
this.oldScroll = this.scrollY;
}

// $(window).on("scroll", function () {
// let windowWidth = $(window).width();
// console.log(windowWidth)
// console.log(orgNavData)

// // // mobile only after window resize
// // if (windowWidth <= mobileBreak) {
// // $('body').removeClass('scroll-disabled');
// // }
// });

$(window).on("resize", function () {
let windowWidth = $(window).width();
Expand Down