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 7d8743315ee1fc7456094606eb12c8d850f94667..7f3c8b035866cebae56f4ce85674ed26597881ed 100644 |
--- a/chrome/browser/resources/print_preview/print_preview_animations.js |
+++ b/chrome/browser/resources/print_preview/print_preview_animations.js |
@@ -78,15 +78,33 @@ function fadeInOutCleanup(animationName) { |
animEl.parentNode.removeChild(animEl); |
} |
-function showLoadingAnimation() { |
- $('dancing-dots-text').classList.remove('hidden'); |
+/** |
+ * Displays |message| followed by three dancing dots animation. |
+ */ |
+function showCustomMessage(message) { |
+ $('custom-message-with-dots').innerHTML = message + |
+ $('dancing-dots-text').innerHTML; |
arv (Not doing code reviews)
2011/09/07 21:53:52
No, don't use innerHTML like this. There is no poi
dpapad
2011/09/08 03:29:20
This results in a larger spacing between the danci
|
+ $('custom-message-with-dots').classList.remove('hidden'); |
arv (Not doing code reviews)
2011/09/07 21:53:52
hidden = false
dpapad
2011/09/08 03:29:20
Done.
|
var pdfViewer = $('pdf-viewer'); |
if (pdfViewer) |
pdfViewer.classList.add('invisible'); |
$('overlay-layer').classList.remove('invisible'); |
} |
-function hideLoadingAnimation() { |
+/** |
+ * Displays the "Preview loading..." animation. |
+ */ |
+function showLoadingAnimation() { |
+ showCustomMessage(localStrings.getString('loading')); |
+} |
+ |
+/** |
+ * Hides the |overlay-layer| and any messages curretnly displayed. |
+ */ |
+function hideOverlayLayer() { |
+ if (hasPendingPrintToPdfRequest) |
vandebo (ex-Chrome)
2011/09/07 21:38:19
It's not clear to me if this is needed. As soon a
dpapad
2011/09/07 23:42:39
This is addressing a corner case, when the user ha
|
+ return; |
+ |
var overlayLayer = $('overlay-layer'); |
overlayLayer.addEventListener('webkitTransitionEnd', loadingAnimationCleanup); |
var pdfViewer = $('pdf-viewer'); |
@@ -96,7 +114,7 @@ function hideLoadingAnimation() { |
} |
function loadingAnimationCleanup() { |
- $('dancing-dots-text').classList.add('hidden'); |
+ $('custom-message-with-dots').classList.add('hidden'); |
$('overlay-layer').removeEventListener('webkitTransitionEnd', |
loadingAnimationCleanup); |
} |