Skip to content
Snippets Groups Projects
Commit 067e0b24 authored by wodby's avatar wodby
Browse files

csfix run

parent c769d8c5
No related branches found
No related tags found
1 merge request!54Feature/istwcms 4790 ebremner tabs links
Showing
with 6478 additions and 4672 deletions
Source diff could not be displayed: it is too large. Options to address this: view the blob.
/**
* @file
*/
var comments = {
"comments" : [
{
......
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.expandcollapse = {
attach: function (context, settings) {
......
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.factfigure = {
attach: function (context, settings) {
......
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.imagegallery = {
attach: function (context, settings) {
......
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.menuhorizontal = {
attach: function (context, settings) {
// uw-horizontal-nav
// uw-horizontal-nav.
$(document).ready(function () {
// Have to add the run this code only once, so that multiple
// loads of the menu are not shown when logged in.
$(document, context).once('menuhorizontal').each( function () {
$(document, context).once('menuhorizontal').each(function () {
const toggle = document.querySelector(".uw-navigation-button");
const navHeader = document.querySelector(".uw-header__navigation");
......@@ -22,7 +26,8 @@
navHeader.classList.remove('open');
navHeader.classList.add('close');
$('html').removeClass('no-scroll');
} else {
}
else {
this.classList.add('active');
this.setAttribute('aria-expanded', 'true');
navHeader.classList.remove('close');
......@@ -49,31 +54,33 @@
this.setAttribute('aria-expanded', 'false');
}
// If hamburger
// If hamburger.
if (screenWidth <= 767) {
// Look at parents and reset the menus
// Look at parents and reset the menus.
if (parent.classList.contains('uw-horizontal-nav--secondary')) {
$('.uw-horizontal-nav--main').css('display', 'block');
}
}
} else if ($('.submenu-active')) {
}
else if ($('.submenu-active')) {
// Get elements with .submnenu-active than close them,
// Get elements with .submnenu-active than close them,.
$('.submenu-active').removeClass('submenu-active').attr('aria-expanded', 'false');
// and open this one.
// And open this one.
this.classList.add("submenu-active");
this.setAttribute('aria-expanded', 'true');
// If hamburger
// If hamburger.
if (screenWidth <= 767) {
// Look at parents and hide other menus if not secondary and open
// Look at parents and hide other menus if not secondary and open.
if (parent.classList.contains('uw-horizontal-nav--secondary')) {
$('.uw-horizontal-nav--main').css('display', 'none');
$('.uw-horizontal-nav--secondary').css('display', 'block');
}
}
} else {
}
else {
this.classList.add('submenu-active');
this.setAttribute('aria-expanded', 'true');
}
......@@ -107,7 +114,7 @@
}
// Space bar keypress to open close menu
// keyCode to be deprecated find way to use key
// keyCode to be deprecated find way to use key.
});
item.addEventListener('keypress', function (e) {
if (e.keyCode == 32) {
......@@ -120,11 +127,11 @@
document.addEventListener("click", closeSubmenu, false);
// If Toggle on page Add event listeners on the menu toggle button.
if (toggle){
if (toggle) {
toggle.addEventListener("click", toggleMenu, false);
}
// apply timeout to the to event firing
// Apply timeout to the to event firing
// so it fires at end of event.
function debouncer(func) {
var timeoutID,
......@@ -142,17 +149,19 @@
// Check the width of the screen and
// force the button click if wider that 767px.
function menuCheckWidth() {
// Set screenWidth var
// Set screenWidth var.
var screenWidth = $(window).width();
navHeader.classList.add('close');
if (screenWidth > 767) {
if ($('html').hasClass('no-scroll')) {
toggle.click();
$('.uw-horizontal-nav').css('display', 'block');
} else {
}
else {
$('.uw-header__navigation').addClass('open');
}
} else {
}
else {
if ($('.uw-header__navigation').hasClass('open')) {
$('.uw-header__navigation').removeClass('open');
$('.uw-header__navigation').addClass('close');
......
/**
* @file
*/
(function ($, Drupal) {
Drupal.behaviors.multitypelist = {
attach: function (context, settings) {
......@@ -10,28 +14,29 @@
return;
}
// Add a click event handler to each tab
// Add a click event handler to each tab.
tabs.forEach(tab => {
tab.addEventListener("click", changeTabs);
});
// Enable arrow navigation between tabs in the tab list
// Enable arrow navigation between tabs in the tab list.
let tabFocus = 0;
tabList.addEventListener("keydown", e => {
// Move right
// Move right.
if (e.keyCode === 39 || e.keyCode === 37) {
tabs[tabFocus].setAttribute("tabindex", -1);
if (e.keyCode === 39) {
tabFocus++;
// If we're at the end, go to the start
// If we're at the end, go to the start.
if (tabFocus >= tabs.length) {
tabFocus = 0;
}
// Move left
} else if (e.keyCode === 37) {
// Move left.
}
else if (e.keyCode === 37) {
tabFocus--;
// If we're at the start, move to the end
// If we're at the start, move to the end.
if (tabFocus < 0) {
tabFocus = tabs.length - 1;
}
......@@ -48,20 +53,20 @@
const parent = target.parentNode;
const grandparent = parent.parentNode;
// Remove all current selected tabs
// Remove all current selected tabs.
parent
.querySelectorAll('[aria-selected="true"]')
.forEach(t => t.setAttribute("aria-selected", false));
// Set this tab as selected
// Set this tab as selected.
target.setAttribute("aria-selected", true);
// Hide all tab panels
// Hide all tab panels.
grandparent
.querySelectorAll('[role="tabpanel"]')
.forEach(p => p.setAttribute("hidden", true));
// Show the selected panel
// Show the selected panel.
grandparent.parentNode
.querySelector(`#${target.getAttribute("aria-controls")}`)
.removeAttribute("hidden");
......
/**
* @file
*/
(function ($, document, Drupal) {
Drupal.behaviors.wcmsheadersearchbar = {
attach: function (context, settings) {
......
/**
* @file
*/
(function ($, document, Drupal) {
Drupal.behaviors.wcmsheadersearch = {
attach: function (context, settings) {
......@@ -19,9 +23,9 @@
}, timeout);
};
}
// Check the width of the screen and
// Check the width of the screen and.
function checkWidth() {
// Set screenWidth var
// Set screenWidth var.
var screenWidth = $(window).width();
if ($('.uw-header__masthead').hasClass('open')) {
......
/**
* @file
*/
(function ($) {
Drupal.behaviors.responsive_menu_combined = {
attach: function (context, settings) {
......@@ -18,7 +22,8 @@
$list.hide();
$('span:first-child',this).html('&#9656;');
$(this).attr('aria-expanded', 'false');
} else {
}
else {
$list.show();
$('span:first-child',this).html('&#9662;');
$(this).attr('aria-expanded', 'true');
......
/**
* Ckeditor Modal
* @file
* Ckeditor Modal.
*/
(function ($, Drupal) {
if ($.ui && $.ui.dialog) {
orig_allowInteraction = $.ui.dialog.prototype._allowInteraction;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment