Commit fbe72e24 authored by estade@chromium.org's avatar estade@chromium.org

ntp4: disable animations for pages that are off screen

also disable all animations during startup (i.e. before the first getAppsCallback call)

BUG=92989
TEST=none


Review URL: http://codereview.chromium.org/7670073

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97739 0039d316-1c4b-4281-b951-d872f2087c98
parent f3c9ad51
...@@ -281,13 +281,15 @@ var CardSlider = (function() { ...@@ -281,13 +281,15 @@ var CardSlider = (function() {
* current position to new position. * current position to new position.
*/ */
selectCard: function(newCardIndex, opt_animate) { selectCard: function(newCardIndex, opt_animate) {
var isChangingCard = newCardIndex >= 0 && var isChangingCard =
newCardIndex < this.cards_.length && !this.cards_[newCardIndex].classList.contains('selected-card');
newCardIndex != this.currentCard;
if (isChangingCard) { if (isChangingCard) {
this.currentCardValue.classList.remove('selected-card');
// If we have a new card index and it is valid then update the left // If we have a new card index and it is valid then update the left
// position and current card index. // position and current card index.
this.currentCard_ = newCardIndex; this.currentCard_ = newCardIndex;
this.currentCardValue.classList.add('selected-card');
} }
this.transformToCurrentCard_(opt_animate); this.transformToCurrentCard_(opt_animate);
......
...@@ -162,6 +162,10 @@ html[dir='rtl'] #attribution { ...@@ -162,6 +162,10 @@ html[dir='rtl'] #attribution {
margin-top: 4px; margin-top: 4px;
} }
.starting-up * {
-webkit-transition: none !important;
}
/* Trash. *********************************************************************/ /* Trash. *********************************************************************/
#trash { #trash {
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
dir:textdirection; dir:textdirection;
hasattribution:hasattribution; hasattribution:hasattribution;
customlogo:customlogo; customlogo:customlogo;
themegravity:themegravity;"> themegravity:themegravity;"
class="starting-up">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title i18n-content="title"></title> <title i18n-content="title"></title>
......
...@@ -326,6 +326,8 @@ cr.define('ntp4', function() { ...@@ -326,6 +326,8 @@ cr.define('ntp4', function() {
// Mark the current page // Mark the current page
dots[cardSlider.currentCard].classList.add('selected'); dots[cardSlider.currentCard].classList.add('selected');
logEvent('apps.layout: ' + (Date.now() - startTime)); logEvent('apps.layout: ' + (Date.now() - startTime));
document.documentElement.classList.remove('starting-up');
} }
/** /**
......
...@@ -154,6 +154,10 @@ ...@@ -154,6 +154,10 @@
-webkit-animation: blipout 0.3s; -webkit-animation: blipout 0.3s;
} }
.tile-page:not(.selected-card) * {
-webkit-transition: none !important;
}
/** Scrollbars ****************************************************************/ /** Scrollbars ****************************************************************/
.tile-page-content::-webkit-scrollbar { .tile-page-content::-webkit-scrollbar {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment