Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: chrome/browser/resources/print_preview_animations.js

Issue 7057047: Print Preview: Preventing "Preview loading..." animation from rendering when not displayed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/print_preview.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Counter used to give webkit animations unique names. 5 // Counter used to give webkit animations unique names.
6 var animationCounter = 0; 6 var animationCounter = 0;
7 7
8 function addAnimation(code) { 8 function addAnimation(code) {
9 var name = 'anim' + animationCounter; 9 var name = 'anim' + animationCounter;
10 animationCounter++; 10 animationCounter++;
(...skipping 26 matching lines...) Expand all
37 }, false ); 37 }, false );
38 } 38 }
39 39
40 function fadeOutElement(el) { 40 function fadeOutElement(el) {
41 if (!el.classList.contains('visible')) 41 if (!el.classList.contains('visible'))
42 return; 42 return;
43 el.style.webkitAnimationName = ''; 43 el.style.webkitAnimationName = '';
44 el.classList.add('closing'); 44 el.classList.add('closing');
45 el.classList.remove('visible'); 45 el.classList.remove('visible');
46 } 46 }
47
48 function showLoadingAnimation() {
49 $('dancing-dots-text').classList.remove('hidden');
50 $('overlay-layer').classList.remove('invisible');
51 }
52
53 function hideLoadingAnimation() {
54 var overlayLayer = $('overlay-layer');
55 overlayLayer.addEventListener('webkitTransitionEnd', loadingAnimationCleanup);
56 overlayLayer.classList.add('invisible');
57 }
58
59 function loadingAnimationCleanup() {
60 $('dancing-dots-text').classList.add('hidden');
61 $('overlay-layer').removeEventListener('webkitTransitionEnd',
62 loadingAnimationCleanup);
63 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698