| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |