| Línea 53... |
Línea 53... |
| 53 |
* Hide clear choice option.
|
53 |
* Hide clear choice option.
|
| 54 |
*
|
54 |
*
|
| 55 |
* @param {Object} clearChoiceContainer The clear choice option container.
|
55 |
* @param {Object} clearChoiceContainer The clear choice option container.
|
| 56 |
*/
|
56 |
*/
|
| 57 |
var hideClearChoiceOption = function(clearChoiceContainer) {
|
57 |
var hideClearChoiceOption = function(clearChoiceContainer) {
|
| 58 |
// We are using .sr-only and aria-hidden together so while the element is hidden
|
58 |
// We are using .visually-hidden and aria-hidden together so while the element is hidden
|
| 59 |
// from both the monitor and the screen-reader, it is still tabbable.
|
59 |
// from both the monitor and the screen-reader, it is still tabbable.
|
| 60 |
clearChoiceContainer.addClass('sr-only');
|
60 |
clearChoiceContainer.addClass('visually-hidden');
|
| 61 |
clearChoiceContainer.attr('aria-hidden', true);
|
61 |
clearChoiceContainer.attr('aria-hidden', true);
|
| 62 |
clearChoiceContainer.find(SELECTORS.LINK).attr('tabindex', -1);
|
62 |
clearChoiceContainer.find(SELECTORS.LINK).attr('tabindex', -1);
|
| 63 |
};
|
63 |
};
|
| Línea 64... |
Línea 64... |
| 64 |
|
64 |
|
| 65 |
/**
|
65 |
/**
|
| 66 |
* Shows clear choice option.
|
66 |
* Shows clear choice option.
|
| 67 |
*
|
67 |
*
|
| 68 |
* @param {Object} clearChoiceContainer The clear choice option container.
|
68 |
* @param {Object} clearChoiceContainer The clear choice option container.
|
| 69 |
*/
|
69 |
*/
|
| 70 |
var showClearChoiceOption = function(clearChoiceContainer) {
|
70 |
var showClearChoiceOption = function(clearChoiceContainer) {
|
| 71 |
clearChoiceContainer.removeClass('sr-only');
|
71 |
clearChoiceContainer.removeClass('visually-hidden');
|
| 72 |
clearChoiceContainer.removeAttr('aria-hidden');
|
72 |
clearChoiceContainer.removeAttr('aria-hidden');
|
| 73 |
clearChoiceContainer.find(SELECTORS.LINK).attr('tabindex', 0);
|
73 |
clearChoiceContainer.find(SELECTORS.LINK).attr('tabindex', 0);
|
| 74 |
clearChoiceContainer.find(SELECTORS.RADIO).prop('disabled', true);
|
74 |
clearChoiceContainer.find(SELECTORS.RADIO).prop('disabled', true);
|