Skip to content

Commit

Permalink
SOEOPSFY24-157, 156, 149: style fixes for news subnav
Browse files Browse the repository at this point in the history
  • Loading branch information
imonroe committed Aug 20, 2024
1 parent 78bba6b commit 320eacc
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ var __webpack_exports__ = {};
toggleButton.attr('aria-expanded', 'true');
toggleButton.removeClass('soe-magazine__navigation-rotate-down');
toggleButton.addClass('soe-magazine__navigation-rotate-up');
topicsItem.addClass('active');
} else {
toggleButton.attr('aria-expanded', 'false');
toggleButton.removeClass('soe-magazine__navigation-rotate-up');
toggleButton.addClass('soe-magazine__navigation-rotate-down');
topicsItem.removeClass('active');
}
});
var mobileToggle = $('#mobile-magazine-landing-nav__toggle');
Expand Down Expand Up @@ -55,14 +53,32 @@ var __webpack_exports__ = {};
$('a.su-multi-menu__link[href="/news"]').closest('li').addClass('su-multi-menu__item--active-trail');
}
}
function fixNewsSubnavActivePath() {
var path = window.location.pathname;
var windowWidth = $(window).width();
if (windowWidth >= 768) {
if (path.indexOf('/future-everything-podcast') !== -1) {
$('.foe_item').addClass('active');
} else {
$('.foe_item').removeClass('active');
}
if (path.indexOf('/news/topic/') !== -1) {
$('.topics_item').addClass('active');
} else {
$('.topics_item').removeClass('active');
}
}
}

// Run on document ready
reorderElements();
fixNewsActivePath();
fixNewsSubnavActivePath();

// Run on window resize
$(window).resize(function () {
reorderElements();
fixNewsSubnavActivePath();
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
toggleButton.attr('aria-expanded', 'true');
toggleButton.removeClass('soe-magazine__navigation-rotate-down');
toggleButton.addClass('soe-magazine__navigation-rotate-up');
topicsItem.addClass('active');
} else {
toggleButton.attr('aria-expanded', 'false');
toggleButton.removeClass('soe-magazine__navigation-rotate-up');
toggleButton.addClass('soe-magazine__navigation-rotate-down');
topicsItem.removeClass('active');
}
});

Expand Down Expand Up @@ -60,13 +58,32 @@
}
}

function fixNewsSubnavActivePath() {
let path = window.location.pathname;
var windowWidth = $(window).width();
if (windowWidth >= 768) {
if (path.indexOf('/future-everything-podcast') !== -1) {
$('.foe_item').addClass('active');
} else {
$('.foe_item').removeClass('active');
}
if (path.indexOf('/news/topic/') !== -1) {
$('.topics_item').addClass('active');
} else {
$('.topics_item').removeClass('active');
}
}
}

// Run on document ready
reorderElements();
fixNewsActivePath();
fixNewsSubnavActivePath();

// Run on window resize
$(window).resize(function() {
reorderElements();
fixNewsSubnavActivePath();
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
display: none;
}

.page-news {
.page-news,
.section-news {
.section-bgcolor--title {
background: none;
color: $su-color-black;
Expand All @@ -28,8 +29,8 @@
width: 100%;
border-top: 1px solid black;
border-bottom: 1px solid black;
padding-top: 1em;
padding-bottom: 1em;
//padding-top: 1em;
//padding-bottom: 1em;

@include grid-media-max("sm") {
width: 90%;
Expand Down Expand Up @@ -163,7 +164,9 @@
font-size: 1.1em;
font-weight: $su-font-semi-bold;
color: $soe-magazine-nav-item-color;
//margin-right: 1em;
padding-top: 15px;
padding-bottom: 15px;
border-bottom: 2px solid transparent;

a {
&:hover,
Expand All @@ -173,6 +176,12 @@
}
}

&:hover,
&:active,
&:focus {
border-bottom: 2px solid $su-color-black;
}

@include grid-media-max("sm") {
text-align: left;
padding: 0.5em;
Expand All @@ -183,6 +192,11 @@
}
}

.news-navigation-nav__item.active {
height: 100%;
border-bottom: 2px solid $su-color-black;
}

.topics-panel__header {
@include grid-media-max("sm") {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/acceptance/Content/BasicPageCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function testDeletedMenuItems(AcceptanceTester $I) {
$I->amOnPage($node->toUrl('delete-form')->toString());
$I->click('Delete');
$I->runDrush('cr');
$I->wait(5);
sleep(5);
$I->amOnPage('/');
$I->cantSeeLink($node_title);
}
Expand Down

0 comments on commit 320eacc

Please sign in to comment.