-
Notifications
You must be signed in to change notification settings - Fork 7.5k
/
Copy pathtime-divider.js
44 lines (37 loc) · 1008 Bytes
/
time-divider.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file time-divider.js
*/
import Component from '../../component.js';
/**
* The separator between the current time and duration.
* Can be hidden if it's not needed in the design.
*
* @extends Component
*/
class TimeDivider extends Component {
/**
* Create the component's DOM element
*
* @return {Element}
* The element that was created.
*/
createEl() {
const el = super.createEl('div', {
className: 'vjs-time-control vjs-time-divider'
}, {
// this element and its contents can be hidden from assistive techs since
// it is made extraneous by the announcement of the control text
// for the current time and duration displays
'aria-hidden': true
});
const div = super.createEl('div');
const span = super.createEl('span', {
textContent: '/'
});
div.appendChild(span);
el.appendChild(div);
return el;
}
}
Component.registerComponent('TimeDivider', TimeDivider);
export default TimeDivider;