| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 animations unique names. | 5 // Counter used to give animations unique names. |
| 6 var animationCounter = 0; | 6 var animationCounter = 0; |
| 7 | 7 |
| 8 var animationEventTracker = new EventTracker(); | 8 var animationEventTracker = new EventTracker(); |
| 9 | 9 |
| 10 function addAnimation(code) { | 10 function addAnimation(code) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 this.style.height = ''; | 103 this.style.height = ''; |
| 104 fadeInAnimationCleanup(this); | 104 fadeInAnimationCleanup(this); |
| 105 } | 105 } |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * Removes the <style> element corresponding to |animationName| from the DOM. | 108 * Removes the <style> element corresponding to |animationName| from the DOM. |
| 109 * @param {HTMLElement} element The animated element. | 109 * @param {HTMLElement} element The animated element. |
| 110 */ | 110 */ |
| 111 function fadeInAnimationCleanup(element) { | 111 function fadeInAnimationCleanup(element) { |
| 112 if (element.style.animationName) { | 112 if (element.style.animationName) { |
| 113 var animEl = document.getElementById(element.style.animationName); | 113 var animEl = $(element.style.animationName); |
| 114 if (animEl) | 114 if (animEl) |
| 115 animEl.parentNode.removeChild(animEl); | 115 animEl.parentNode.removeChild(animEl); |
| 116 element.style.animationName = ''; | 116 element.style.animationName = ''; |
| 117 animationEventTracker.remove(element, 'animationend'); | 117 animationEventTracker.remove(element, 'animationend'); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Fades in a printing option existing under |el|. | 122 * Fades in a printing option existing under |el|. |
| 123 * @param {HTMLElement} el The element to hide. | 123 * @param {HTMLElement} el The element to hide. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 while (el.childNodes.length > 0) | 188 while (el.childNodes.length > 0) |
| 189 div.appendChild(el.firstChild); | 189 div.appendChild(el.firstChild); |
| 190 el.appendChild(div); | 190 el.appendChild(div); |
| 191 } | 191 } |
| 192 | 192 |
| 193 div.className = ''; | 193 div.className = ''; |
| 194 div.classList.add('collapsible'); | 194 div.classList.add('collapsible'); |
| 195 for (var i = 0; i < classes.length; i++) | 195 for (var i = 0; i < classes.length; i++) |
| 196 div.classList.add(classes[i]); | 196 div.classList.add(classes[i]); |
| 197 } | 197 } |
| OLD | NEW |