Fix various team accessibility issues.

Authors:
  - Peter Fogg
  - Daniel Friedman

TNL-1953
This commit is contained in:
Peter Fogg
2015-08-03 14:18:31 -04:00
committed by Daniel Friedman
parent 00eb18a1f9
commit 26bbbb967e
23 changed files with 129 additions and 42 deletions

View File

@@ -23,6 +23,8 @@
'text!templates/components/card/card.underscore'],
function ($, _, Backbone, cardTemplate) {
var CardView = Backbone.View.extend({
tagName: 'li',
events: {
'click .action' : 'action'
},
@@ -82,7 +84,8 @@
action_class: this.callIfFunction(this.actionClass),
action_url: this.callIfFunction(this.actionUrl),
action_content: this.callIfFunction(this.actionContent),
configuration: this.callIfFunction(this.configuration)
configuration: this.callIfFunction(this.configuration),
srInfo: this.srInfo
}));
var detailsEl = this.$el.find('.card-meta');
_.each(this.callIfFunction(this.details), function (detail) {

View File

@@ -8,7 +8,8 @@ define(['backbone'], function (Backbone) {
defaults: {
'title': '',
'description': '',
'breadcrumbs': null
'breadcrumbs': null,
'nav_aria_label': ''
}
});

View File

@@ -48,7 +48,11 @@
}));
self.$('.page-content-nav').append(tabEl);
});
if(Backbone.history.getHash() === "") {
// Re-display the default (first) tab if the
// current route does not belong to one of the
// tabs. Otherwise continue displaying the tab
// corresponding to the current URL.
if (!(Backbone.history.getHash() in this.urlMap)) {
this.setActiveTab(0);
}
return this;
@@ -70,7 +74,7 @@
view.setElement(this.$('.page-content-main')).render();
this.$('.sr-is-focusable.sr-tab').focus();
if (this.router) {
this.router.navigate(tab.url, {replace: true, trigger: true});
this.router.navigate(tab.url, {replace: true});
}
},

View File

@@ -13,7 +13,7 @@
var testBreadcrumbs = function (breadcrumbs) {
model.set('breadcrumbs', breadcrumbs);
expect(view.$el.html()).toContain('<nav class="breadcrumbs">');
expect(view.$('nav.breadcrumbs').length).toBe(1);
_.each(view.$('.nav-item'), function (el, index) {
expect($(el).attr('href')).toEqual(breadcrumbs[index].url);
expect($(el).text()).toEqual(breadcrumbs[index].title);

View File

@@ -101,7 +101,7 @@
view.$('.nav-item[data-index=1]').click();
expect(Backbone.history.navigate).toHaveBeenCalledWith(
'test 2',
{replace: true, trigger: true}
{replace: true}
);
});

View File

@@ -118,7 +118,7 @@
.u-field-message-help,
.u-field-message-notification {
color: $gray-l1;
color: $gray;
}
}