Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
27 lines
675 B
JavaScript
Executable file
27 lines
675 B
JavaScript
Executable file
define(function(require) {
|
|
'use strict';
|
|
|
|
var AccessibilityHelper = require('shared/js/accessibility_helper');
|
|
|
|
/**
|
|
* Abstraction for handling the Tabs links at the bottom of the UI.
|
|
* @param {HTMLElement} element The containing element for the Tabs UI.
|
|
*/
|
|
function Tabs(element) {
|
|
this.element = element;
|
|
this.links = element.querySelectorAll('a');
|
|
this.element.addEventListener('click', this);
|
|
}
|
|
|
|
/**
|
|
* Update selected attributes for the selected tab.
|
|
* Also emit a 'selected' event with the relevant data.
|
|
*/
|
|
Tabs.prototype.handleEvent = function tabsHandleEvent(event) {
|
|
AccessibilityHelper.setAriaSelected(event.target, this.links);
|
|
};
|
|
|
|
|
|
return Tabs;
|
|
|
|
});
|