Skip to content

Commit

Permalink
Merge branch 'main' into feature/cdpt-2268-fix-horizontal-lists
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyHazlehurst authored Jan 17, 2025
2 parents 5bfa652 + 97533a6 commit 07e35c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
28 changes: 0 additions & 28 deletions public/app/themes/justice/src/js/legacy/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,6 @@ jQuery(document).ready(function () {
* The following code is legacy and is not yet fully understood.
*/

//tab-group
jQuery('.tab-group .tabs').each(function () {
//get tabs for this group
jQuery(this).children('li').each(function (i) {
jQuery(this).click(function (e, auto) {
if (typeof auto == "undefined") jQuery(document).stopTime('highlight');
e.preventDefault();
var thisTabGrp = jQuery(this).closest('.tab-group');
//toggle selected tab
jQuery(thisTabGrp).children('.tabs').children('li.selected').removeClass();
jQuery(this).addClass('selected');
//toggle tab contents
jQuery(thisTabGrp).children('.tab-content').children().each(function (j) {
i == j ? jQuery(this).fadeIn(250, 'swing') : jQuery(this).fadeOut(250, 'swing');
});
});
});
});

//top nav sub
jQuery('.menu-top li[class!="more"] .flyout-container div[class^="content"]').each(function () {
var cols = 1;
Expand Down Expand Up @@ -57,15 +38,6 @@ jQuery(document).ready(function () {
}
});

//highlight auto-cycle
if (jQuery('#highlight').length > 0) {
setInterval(function() {
var index = jQuery('#highlight .tabs li.selected').index();
var size = jQuery('#highlight .tabs li').length;
index < size - 1 ? jQuery('#highlight .tabs li:eq(' + (index + 1) + ')').trigger('click', ['auto']) : jQuery('#highlight .tabs li:eq(0)').trigger('click', ['auto']);
}, 5000);
}

//split lv2-listing
if (jQuery('div.lv2-listing').length > 0) {
var ul = '<ul>';
Expand Down
11 changes: 7 additions & 4 deletions public/app/themes/justice/src/patch/js/ccfw-frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ import { CCFW } from './ccfw-gtm'
this.$el.show()
this.$cookieSettingsButton.hide()

// the cookie banner is now at the top, so we scroll to the top
$([document.documentElement, document.body]).animate({
scrollTop: $('#ccfw-page-banner').offset().top
}, 200)
const banner = $('#ccfw-page-banner');
// If the cookie banner exists, scroll to the top
if (banner.length > 0) {
$([document.documentElement, document.body]).animate({
scrollTop: banner.offset().top
}, 200)
}
},
hideBanner: function () {
this.$el.hide()
Expand Down

0 comments on commit 07e35c2

Please sign in to comment.