Skip to content
Snippets Groups Projects
Commit 26da40b7 authored by Liam Morland's avatar Liam Morland
Browse files

Coding standards

parent 560ba639
No related branches found
No related tags found
1 merge request!10Coding standards
Showing
with 30 additions and 41 deletions
...@@ -35,4 +35,4 @@ ...@@ -35,4 +35,4 @@
.mobile-menu, .mobile-menu,
.mobile-menu-button{ .mobile-menu-button{
display:none !important; display:none !important;
} }
\ No newline at end of file
...@@ -65,4 +65,4 @@ ...@@ -65,4 +65,4 @@
padding-right: 0; padding-right: 0;
} }
} }
} }
\ No newline at end of file
...@@ -304,4 +304,4 @@ ...@@ -304,4 +304,4 @@
color: gesso-grayscale('gray-6'); color: gesso-grayscale('gray-6');
} }
} }
\ No newline at end of file
...@@ -6,4 +6,4 @@ title: Anchor link ...@@ -6,4 +6,4 @@ title: Anchor link
__Variables:__ __Variables:__
* anchor_link: [array] Variables for anchor link. * anchor_link: [array] Variables for anchor link.
* anchor: [string] Anchor element. * anchor: [string] Anchor element.
* anchor_url: [string] Current page url for anchor element. * anchor_url: [string] Current page url for anchor element.
\ No newline at end of file
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
// disable margin for layout builder blocks // disable margin for layout builder blocks
.block--provider-layout-builder { .block--provider-layout-builder {
margin-bottom: 0; margin-bottom: 0;
} }
\ No newline at end of file
...@@ -7,4 +7,4 @@ ...@@ -7,4 +7,4 @@
font-size: .88889rem; font-size: .88889rem;
padding: .5rem; padding: .5rem;
} }
} }
\ No newline at end of file
...@@ -34,5 +34,4 @@ __Variables:__ ...@@ -34,5 +34,4 @@ __Variables:__
* type: [string] Type of the tag, it will add class ".tag--type". * type: [string] Type of the tag, it will add class ".tag--type".
* size: [string] Size of the tag, it will add class ".tag--size" * size: [string] Size of the tag, it will add class ".tag--size"
* url: [string] URL of the tag. * url: [string] URL of the tag.
* title: [string] Title of the tag. * title: [string] Title of the tag.
\ No newline at end of file
// @file // @file
// Styles for Copyright. // Styles for Copyright.
// .copyright {} // .copyright {}
\ No newline at end of file
(function ($, Drupal) { (function ($, Drupal) {
Drupal.behaviors.expandcollapse = { Drupal.behaviors.expandcollapse = {
attach: function (context, settings) { attach: function (context, settings) {
$(document).ready(function(){ $(document).ready(function () {
$('.uw-expand-collapse').each(function() { $('.uw-expand-collapse').each(function () {
// Get the id of the expand collapse. // Get the id of the expand collapse.
var id = '#uw-expand-collapse-' + $(this).data('id'); var id = '#uw-expand-collapse-' + $(this).data('id');
// When the expand all button is clicked, expand all the items. // When the expand all button is clicked, expand all the items.
$(id + ' [data-type="expand-all"]').click(function() { $(id + ' [data-type="expand-all"]').click(function () {
// Find each of the buttons, which are the titles and change // Find each of the buttons, which are the titles and change
// aria-expanded and add class to show expanded. // aria-expanded and add class to show expanded.
$(id + ' .uw-expand-collapse__items button').each(function() { $(id + ' .uw-expand-collapse__items button').each(function () {
$(this).attr('aria-expanded', true); $(this).attr('aria-expanded', true);
$(this).addClass('uw-expanded'); $(this).addClass('uw-expanded');
}); });
// Find each of the text and add css to display them. // Find each of the text and add css to display them.
$(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function() { $(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function () {
$(this).css('display', 'block'); $(this).css('display', 'block');
}); });
}); });
// When the collapse all button is clicked, collapse all the items. // When the collapse all button is clicked, collapse all the items.
$(id + ' [data-type="collapse-all"]').click(function() { $(id + ' [data-type="collapse-all"]').click(function () {
// Find each of the buttons, which are the titles and change // Find each of the buttons, which are the titles and change
// aria-expanded and remove class to show collapsed. // aria-expanded and remove class to show collapsed.
$(id + ' .uw-expand-collapse__items button').each(function() { $(id + ' .uw-expand-collapse__items button').each(function () {
$(this).attr('aria-expanded', true); $(this).attr('aria-expanded', true);
$(this).removeClass('uw-expanded'); $(this).removeClass('uw-expanded');
}); });
// Find each of the text and add css to display them. // Find each of the text and add css to display them.
$(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function() { $(id + ' .uw-expand-collapse__items .uw-expand-collapse__text').each(function () {
$(this).css('display', 'none'); $(this).css('display', 'none');
}); });
}); });
// Step through each of the titles and add a click function. // Step through each of the titles and add a click function.
$(id + ' .uw-expand-collapse__items button').click(function() { $(id + ' .uw-expand-collapse__items button').click(function () {
// If this has an expanded class, remove it and change aria expanded to false. // If this has an expanded class, remove it and change aria expanded to false.
// Otherwise add the expanded class and set aria-expanded to true. // Otherwise add the expanded class and set aria-expanded to true.
......
(function ($, Drupal) { (function ($, Drupal) {
Drupal.behaviors.factfigure = { Drupal.behaviors.factfigure = {
attach: function (context, settings) { attach: function (context, settings) {
$(document).ready(function(){ $(document).ready(function () {
// Step through each FF on the page. // Step through each FF on the page.
$('.uw-ff').each(function() { $('.uw-ff').each(function () {
var result = $(this).find('.uw-ff__has-carousel-settings').length; var result = $(this).find('.uw-ff__has-carousel-settings').length;
......
(function ($, Drupal) { (function ($, Drupal) {
Drupal.behaviors.imagegallery = { Drupal.behaviors.imagegallery = {
attach: function (context, settings) { attach: function (context, settings) {
$(document).ready(function(){ $(document).ready(function () {
// Step through each FF on the page. // Step through each FF on the page.
$('.uw-ig').each(function() { $('.uw-ig').each(function () {
// Get the id to reference the individual FF. // Get the id to reference the individual FF.
// Need this to ensure that if more than one FF on the page, // Need this to ensure that if more than one FF on the page,
......
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
font-weight: gesso-font-weight(regular); font-weight: gesso-font-weight(regular);
max-width:8.5rem; max-width:8.5rem;
} }
} }
\ No newline at end of file
...@@ -7,4 +7,4 @@ __Variables:__ ...@@ -7,4 +7,4 @@ __Variables:__
* mailman: [array] Variables for mailman. * mailman: [array] Variables for mailman.
* server: [string] Mailman server url. * server: [string] Mailman server url.
* servername: [string] Mailman server name. * servername: [string] Mailman server name.
* uniqueid: [string] Unique id of the mailman component. * uniqueid: [string] Unique id of the mailman component.
\ No newline at end of file
...@@ -81,4 +81,4 @@ ...@@ -81,4 +81,4 @@
grid-row: 1; grid-row: 1;
} }
} }
} }
\ No newline at end of file
...@@ -558,4 +558,4 @@ $faculties: 'org-default', 'org-ahs', 'org-art', 'org-eng', 'org-env', 'org-mat' ...@@ -558,4 +558,4 @@ $faculties: 'org-default', 'org-ahs', 'org-art', 'org-eng', 'org-env', 'org-mat'
} }
} }
\ No newline at end of file
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
Drupal.behaviors.menuhorizontal = { Drupal.behaviors.menuhorizontal = {
attach: function (context, settings) { attach: function (context, settings) {
// uw-horizontal-nav // uw-horizontal-nav
$(document).ready(function(){ $(document).ready(function () {
// Have to add the run this code only once, so that multiple // Have to add the run this code only once, so that multiple
// loads of the menu are not shown when logged in. // 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 toggle = document.querySelector(".uw-navigation-button");
const navHeader = document.querySelector(".uw-header__navigation"); const navHeader = document.querySelector(".uw-header__navigation");
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
var parent = this.parentNode.parentNode.parentNode.parentNode; var parent = this.parentNode.parentNode.parentNode.parentNode;
var screenWidth = $(window).width(); var screenWidth = $(window).width();
if (this.classList.contains('submenu-active')) { if (this.classList.contains('submenu-active')) {
this.classList.remove('submenu-active'); this.classList.remove('submenu-active');
...@@ -80,7 +79,6 @@ ...@@ -80,7 +79,6 @@
} }
} }
/* Close Submenu From Anywhere */ /* Close Submenu From Anywhere */
function closeSubmenu(e) { function closeSubmenu(e) {
...@@ -123,7 +121,6 @@ ...@@ -123,7 +121,6 @@
// Add event listeners on the menu toggle button. // Add event listeners on the menu toggle button.
toggle.addEventListener("click", toggleMenu, false); 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. // so it fires at end of event.
function debouncer(func) { function debouncer(func) {
...@@ -168,7 +165,6 @@ ...@@ -168,7 +165,6 @@
) )
); );
menuCheckWidth(); menuCheckWidth();
}); });
}); });
......
...@@ -78,4 +78,4 @@ $menu-horizontal-sub-font-size: rem(gesso-font-size(-2)); ...@@ -78,4 +78,4 @@ $menu-horizontal-sub-font-size: rem(gesso-font-size(-2));
} }
} }
} }
} }
\ No newline at end of file
...@@ -169,4 +169,4 @@ ...@@ -169,4 +169,4 @@
} }
} }
} }
\ No newline at end of file
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
const parent = target.parentNode; const parent = target.parentNode;
const grandparent = parent.parentNode; const grandparent = parent.parentNode;
// Remove all current selected tabs // Remove all current selected tabs
parent parent
.querySelectorAll('[aria-selected="true"]') .querySelectorAll('[aria-selected="true"]')
...@@ -71,8 +70,3 @@ ...@@ -71,8 +70,3 @@
} }
}; };
})(jQuery, Drupal); })(jQuery, Drupal);
...@@ -18,4 +18,4 @@ ...@@ -18,4 +18,4 @@
.readmore-link__accessibility-description { .readmore-link__accessibility-description {
@extend %visually-hidden; @extend %visually-hidden;
} }
\ No newline at end of file
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