Skip to content

Commit

Permalink
Merge pull request #1327 from CuBoulder/issue/1316
Browse files Browse the repository at this point in the history
Remove Mega menu from Sticky menus and add default link color
  • Loading branch information
jcsparks authored and web-flow committed Sep 24, 2024
2 parents 3cffc3f + f4998bf commit f6f19d6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- ### Remove Mega menu from Sticky menus and add default link color
Resolves #1317 and #1316.
Removes mega menus from the sticky menu and converts them into normal links. It also adds base default colors for links in mega menus to account for site settings.
---

- ### body template move
The basic page body block wasn't being rendered at the right level. This caused it not to be editable or removable at the layout builder level. If multiple body sections were added they couldn't be deleted and a "body" title was added to each new addition.

Expand Down
8 changes: 8 additions & 0 deletions css/block/ucb-mega-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@
flex-wrap: wrap;
}

.ucb-main-nav-container .ucb-mega-menu .menu-item .mega-menu-wrapper a{
color: #0277bd;
}

.ucb-main-nav-container .ucb-mega-menu .menu-item .mega-menu-wrapper a:hover{
color: #B71C1C;
}

@media only screen and (max-width: 767px) {

.ucb-mega-menu-column-3 div,
Expand Down
5 changes: 5 additions & 0 deletions css/ucb-sticky-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,8 @@
.sticky-menu-inner .ucb-menu li.menu-item a.nav-link:hover {
color: var(--ucb-gold);
}

.sticky-menu-inner .ucb-mega-menu,
.sticky-menu-inner .ucb-mega-menu-icon {
display: none;
}
14 changes: 13 additions & 1 deletion js/ucb-mega-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@ const megaMenuList = [...megaMenuElementList].map(collapseEl => new bootstrap.Co
}
}
}
})
})

// Disable Sticky Menu Mega Menus
const stickyMenu = document.getElementsByClassName("ucb-sticky-menu");
for (let i = 0; i < stickyMenu.length; i++) {
const allMegaMenus = stickyMenu[i].getElementsByClassName("ucb-mega-menu-outer-link");
for (let j = 0; j < allMegaMenus.length; j++) {
allMegaMenus[j].removeAttribute("data-bs-toggle");
allMegaMenus[j].removeAttribute("data-bs-target");
allMegaMenus[j].removeAttribute("aria-expanded");
allMegaMenus[j].removeAttribute("aria-controls");
}
}

0 comments on commit f6f19d6

Please sign in to comment.