Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add aria support
- Loading branch information
1 parent
d0e1965
commit 5659c0e
Showing
8 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters