Index: chrome/browser/resources/print_preview/print_preview_animations.js |
diff --git a/chrome/browser/resources/print_preview/print_preview_animations.js b/chrome/browser/resources/print_preview/print_preview_animations.js |
index c088696110fcb68af3e52f030e389078dc74c1b6..82ea3c78b3e274a6e22f3404dabbc24132d2a69e 100644 |
--- a/chrome/browser/resources/print_preview/print_preview_animations.js |
+++ b/chrome/browser/resources/print_preview/print_preview_animations.js |
@@ -37,8 +37,10 @@ function getFadeInAnimationCode(targetHeight) { |
* Fades in an element. Used for both printing options and error messages |
* appearing underneath the textfields. |
* @param {HTMLElement} el The element to be faded in. |
+ * @param {boolean=} opt_justShow Whether {@code el} should be shown with no |
+ * animation. |
*/ |
-function fadeInElement(el) { |
+function fadeInElement(el, opt_justShow) { |
if (el.classList.contains('visible')) |
return; |
el.classList.remove('closing'); |
@@ -47,10 +49,14 @@ function fadeInElement(el) { |
el.style.height = 'auto'; |
var height = el.offsetHeight; |
el.style.height = height + 'px'; |
- var animName = addAnimation(getFadeInAnimationCode(height)); |
- animationEventTracker_.add( |
- el, 'webkitAnimationEnd', onFadeInAnimationEnd.bind(el), false); |
- el.style.webkitAnimationName = animName; |
+ if (opt_justShow) { |
+ el.style.opacity = 1; |
+ } else { |
+ var animName = addAnimation(getFadeInAnimationCode(height)); |
+ animationEventTracker_.add( |
+ el, 'webkitAnimationEnd', onFadeInAnimationEnd.bind(el), false); |
+ el.style.webkitAnimationName = animName; |
+ } |
el.classList.add('visible'); |
} |
@@ -113,20 +119,23 @@ function fadeInAnimationCleanup(element) { |
/** |
* Fades in a printing option existing under |el|. |
* @param {HTMLElement} el The element to hide. |
+ * @param {boolean=} opt_justShow Whether {@code el} should be hidden with no |
+ * animation. |
*/ |
-function fadeInOption(el) { |
+function fadeInOption(el, opt_justShow) { |
if (el.classList.contains('visible')) |
return; |
// To make the option visible during the first fade in. |
el.hidden = false; |
- wrapContentsInDiv(el.querySelector('h1'), ['invisible']); |
+ var leftColumn = el.querySelector('.left-column'); |
+ wrapContentsInDiv(leftColumn, ['invisible']); |
var rightColumn = el.querySelector('.right-column'); |
wrapContentsInDiv(rightColumn, ['invisible']); |
var toAnimate = el.querySelectorAll('.collapsible'); |
for (var i = 0; i < toAnimate.length; i++) |
- fadeInElement(toAnimate[i]); |
+ fadeInElement(toAnimate[i], opt_justShow); |
el.classList.add('visible'); |
} |
@@ -140,7 +149,8 @@ function fadeOutOption(el, opt_justHide) { |
if (!el.classList.contains('visible')) |
return; |
- wrapContentsInDiv(el.querySelector('h1'), ['visible']); |
+ var leftColumn = el.querySelector('.left-column'); |
+ wrapContentsInDiv(leftColumn, ['visible']); |
var rightColumn = el.querySelector('.right-column'); |
wrapContentsInDiv(rightColumn, ['visible']); |