/
aria.js
23 lines (16 loc) · 883 Bytes
/
aria.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function aria ( ) {
bindEvent('update', function ( values, handleNumber, unencoded, tap, positions ) {
// Update Aria Values for all handles, as a change in one changes min and max values for the next.
scope_HandleNumbers.forEach(function( handleNumber ){
var handle = scope_Handles[handleNumber];
var min = checkHandlePosition(scope_Locations, handleNumber, 0, true, true, true);
var max = checkHandlePosition(scope_Locations, handleNumber, 100, true, true, true);
var now = positions[handleNumber];
var text = options.ariaFormat.to(unencoded[handleNumber]);
handle.children[0].setAttribute('aria-valuemin', min.toFixed(1));
handle.children[0].setAttribute('aria-valuemax', max.toFixed(1));
handle.children[0].setAttribute('aria-valuenow', now.toFixed(1));
handle.children[0].setAttribute('aria-valuetext', text);
});
});
}