Skip to content
Snippets Groups Projects
Commit b711e100 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray
Browse files

Fix JS; make buttons sr accessibile; fix overlay

parent 49ee81ca
Branches
Tags
No related merge requests found
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, no-unused-vars, one-var, one-var-declaration-per-line, vars-on-top, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, no-unused-vars, one-var, one-var-declaration-per-line, vars-on-top, max-len */
import _ from 'underscore'; import _ from 'underscore';
import Cookies from 'js-cookie';
import NewNavSidebar from './new_sidebar'; import NewNavSidebar from './new_sidebar';
   
(function() { (function() {
Loading
@@ -54,8 +55,11 @@ import NewNavSidebar from './new_sidebar';
Loading
@@ -54,8 +55,11 @@ import NewNavSidebar from './new_sidebar';
} }
   
$(() => { $(() => {
var newNavSidebar = new NewNavSidebar(); if (Cookies.get('new_nav') === 'true') {
const newNavSidebar = new NewNavSidebar();
newNavSidebar.bindEvents(); newNavSidebar.bindEvents();
}
$(window).on('scroll', _.throttle(applyScrollNavClass, 100)); $(window).on('scroll', _.throttle(applyScrollNavClass, 100));
}); });
}).call(window); }).call(window);
Loading
@@ -11,9 +11,9 @@ export default class NewNavSidebar {
Loading
@@ -11,9 +11,9 @@ export default class NewNavSidebar {
} }
   
bindEvents() { bindEvents() {
this.$openSidebar.on('click', e => this.toggleSidebarNav(e, true)); this.$openSidebar.on('click', () => this.toggleSidebarNav(true));
this.$closeSidebar.on('click', e => this.toggleSidebarNav(e, false)); this.$closeSidebar.on('click', () => this.toggleSidebarNav(false));
this.$overlay.on('click', e => this.toggleSidebarNav(e, false)); this.$overlay.on('click', () => this.toggleSidebarNav(false));
} }
   
toggleSidebarNav(show) { toggleSidebarNav(show) {
Loading
Loading
Loading
@@ -247,7 +247,7 @@ $new-sidebar-width: 220px;
Loading
@@ -247,7 +247,7 @@ $new-sidebar-width: 220px;
   
&.mobile-nav-open { &.mobile-nav-open {
display: block; display: block;
position: absolute; position: fixed;
background-color: $black-transparent; background-color: $black-transparent;
height: 100%; height: 100%;
width: 100%; width: 100%;
Loading
Loading
Loading
@@ -4,7 +4,8 @@
Loading
@@ -4,7 +4,8 @@
%nav.breadcrumbs{ role: "navigation" } %nav.breadcrumbs{ role: "navigation" }
.breadcrumbs-container{ class: [container_class, @content_class] } .breadcrumbs-container{ class: [container_class, @content_class] }
- if defined?(@new_sidebar) - if defined?(@new_sidebar)
%button.toggle-mobile-nav = button_tag class: 'toggle-mobile-nav', type: 'button' do
%span.sr-only Open sidebar
= icon ('bars') = icon ('bars')
.breadcrumbs-links.js-title-container .breadcrumbs-links.js-title-container
- unless hide_top_links - unless hide_top_links
Loading
Loading
Loading
@@ -4,7 +4,8 @@
Loading
@@ -4,7 +4,8 @@
.avatar-container.s40.settings-avatar .avatar-container.s40.settings-avatar
= icon('wrench') = icon('wrench')
.project-title Admin Area .project-title Admin Area
%button.close-nav-button = button_tag class: 'close-nav-button', type: 'button' do
%span.sr-only Close sidebar
= icon ('times') = icon ('times')
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(controller: %w(dashboard admin projects users groups jobs runners cohorts), html_options: {class: 'home'}) do = nav_link(controller: %w(dashboard admin projects users groups jobs runners cohorts), html_options: {class: 'home'}) do
Loading
Loading
Loading
@@ -5,7 +5,8 @@
Loading
@@ -5,7 +5,8 @@
= image_tag group_icon(@group), class: "avatar s40 avatar-tile" = image_tag group_icon(@group), class: "avatar s40 avatar-tile"
.group-title .group-title
= @group.name = @group.name
%button.close-nav-button = button_tag class: 'close-nav-button', type: 'button' do
%span.sr-only Close sidebar
= icon ('times') = icon ('times')
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: ['groups#show', 'groups#activity', 'groups#subgroups'], html_options: { class: 'home' }) do = nav_link(path: ['groups#show', 'groups#activity', 'groups#subgroups'], html_options: { class: 'home' }) do
Loading
Loading
Loading
@@ -4,7 +4,8 @@
Loading
@@ -4,7 +4,8 @@
.avatar-container.s40.settings-avatar .avatar-container.s40.settings-avatar
= icon('user') = icon('user')
.project-title User Settings .project-title User Settings
%button.close-nav-button = button_tag class: 'close-nav-button', type: 'button' do
%span.sr-only Close sidebar
= icon ('times') = icon ('times')
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
Loading
Loading
Loading
@@ -6,7 +6,8 @@
Loading
@@ -6,7 +6,8 @@
= project_icon(@project, alt: @project.name, class: 'avatar s40 avatar-tile') = project_icon(@project, alt: @project.name, class: 'avatar s40 avatar-tile')
.project-title .project-title
= @project.name = @project.name
%button.close-nav-button = button_tag class: 'close-nav-button', type: 'button' do
%span.sr-only Close sidebar
= icon ('times') = icon ('times')
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do = nav_link(path: ['projects#show', 'projects#activity', 'cycle_analytics#show'], html_options: { class: 'home' }) do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment