VulpesOS/gaia/apps/clock/js/tabs.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

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;
});