Chromium Code Reviews| Index: chrome/browser/resources/shared/js/cr/ui/card_slider.js |
| diff --git a/chrome/browser/resources/shared/js/cr/ui/card_slider.js b/chrome/browser/resources/shared/js/cr/ui/card_slider.js |
| index 52986321f916262b7c43b475d52ff1fda59691bf..1ddf69d06dacea8815220367443e1eedf1f0a3b5 100644 |
| --- a/chrome/browser/resources/shared/js/cr/ui/card_slider.js |
| +++ b/chrome/browser/resources/shared/js/cr/ui/card_slider.js |
| @@ -186,6 +186,11 @@ cr.define('cr.ui', function() { |
| this.updateCardWidths_(); |
| + // Mark all cards as hidden for accessibility. The selected card will |
| + // be marked visible during selectCard(). |
| + for (var i = 0; i < cards.length; i++) |
| + this.cards_[i].setAttribute('aria-hidden', true); |
|
Dan Beam
2012/09/14 02:48:38
nit: 2 \s indent, optionally we usually use curlie
aboxhall
2012/09/14 03:50:37
Done.
|
| + |
| // Jump to the given card index. |
| this.selectCard(index); |
| }, |
| @@ -350,6 +355,10 @@ cr.define('cr.ui', function() { |
| this.cards_ = Array.prototype.concat.call( |
| this.cards_.slice(0, index), card, this.cards_.slice(index)); |
| + // Mark the new card as hidden for accessibility. This will be corrected |
|
Dan Beam
2012/09/14 02:48:38
nit: 1 \s between sentences
aboxhall
2012/09/14 03:50:37
Done.
|
| + // during selectCard() if this is the selected card. |
| + card.setAttribute('aria-hidden', true); |
| + |
| if (this.currentCard_ == -1) |
| this.currentCard_ = 0; |
| else if (index <= this.currentCard_) |
| @@ -471,10 +480,13 @@ cr.define('cr.ui', function() { |
| isChangingCard = true; |
| if (isChangingCard) { |
| - if (previousCard) |
| + if (previousCard) { |
| previousCard.classList.remove('selected-card'); |
| + previousCard.setAttribute('aria-hidden', true); |
| + } |
| this.currentCard_ = newCardIndex; |
| this.currentCardValue.classList.add('selected-card'); |
| + this.currentCardValue.setAttribute('aria-hidden', false); |
| } |
| var willTransitionHappen = this.transformToCurrentCard_(opt_animate); |