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 f7da9aa002afd9229f44fa44e1da20302f8da5dc..68831d57d93681959735ede186329549adb0a2fc 100644 |
| --- a/chrome/browser/resources/shared/js/cr/ui/card_slider.js |
| +++ b/chrome/browser/resources/shared/js/cr/ui/card_slider.js |
| @@ -344,7 +344,7 @@ cr.define('cr.ui', function() { |
| if (this.currentCard_ == -1) |
| this.currentCard_ = 0; |
| else if (index <= this.currentCard_) |
| - this.selectCard(this.currentCard_ + 1, false, true); |
| + this.selectCard(this.currentCard_ + 1, false, true, true); |
| this.fireAddedEvent_(card, index); |
| }, |
| @@ -436,14 +436,20 @@ cr.define('cr.ui', function() { |
| * current position to new position. |
| * @param {boolean=} opt_dontNotify If true, don't tell subscribers that |
| * we've changed cards. |
| + * @param {boolean=} opt_forceChange If true, ignore if the card already |
| + * selected. |
| */ |
| - selectCard: function(newCardIndex, opt_animate, opt_dontNotify) { |
| + selectCard: function(newCardIndex, opt_animate, opt_dontNotify, |
|
Dan Beam
2012/02/28 22:59:22
btw, you should probably be preferring a param per
GeorgeY
2012/02/29 00:15:45
Done.
|
| + opt_forceChange) { |
| this.assertValidIndex_(newCardIndex); |
| var previousCard = this.currentCardValue; |
| var isChangingCard = |
| !this.cards_[newCardIndex].classList.contains('selected-card'); |
| + if (typeof opt_forceChange != 'undefined' && opt_forceChange) |
| + isChangingCard = true; |
| + |
| if (isChangingCard) { |
| if (previousCard) |
| previousCard.classList.remove('selected-card'); |