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

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

Issue 2921783003: WebUI: Fix/suppress some existing violations of no-restricted-globals. (Closed)
Patch Set: Fix svg Created 3 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/instant/instant.js ('k') | chrome/browser/resources/print_preview/settings/other_options_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698