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

Side by Side Diff: ui/login/resource_loader.js

Issue 2004553002: Fix opacity transition of pin keyboard on lockscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 7 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
« no previous file with comments | « chrome/browser/resources/chromeos/login/lock.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * @fileoverview Deferred resource loader for OOBE/Login screens. 6 * @fileoverview Deferred resource loader for OOBE/Login screens.
7 */ 7 */
8 8
9 cr.define('cr.ui.login.ResourceLoader', function() { 9 cr.define('cr.ui.login.ResourceLoader', function() {
10 'use strict'; 10 'use strict';
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 }, { timeout: opt_idleTimeoutMs }); 201 }, { timeout: opt_idleTimeoutMs });
202 }; 202 };
203 203
204 if (document.readyState == 'complete') { 204 if (document.readyState == 'complete') {
205 loadOnIdle(); 205 loadOnIdle();
206 } else { 206 } else {
207 window.addEventListener('DOMContentLoaded', loadOnIdle); 207 window.addEventListener('DOMContentLoaded', loadOnIdle);
208 } 208 }
209 } 209 }
210 210
211 /**
212 * Wait until the element with the given |id| has finished its layout,
213 * specifically, after it has an offsetHeight > 0.
214 * @param {string} id Identifier of the element to wait for.
215 * @param {function()} callback Function to invoke when done loading.
216 */
217 function waitUntilLayoutComplete(id, callback) {
218 function doWait() {
xiyuan 2016/05/20 21:06:32 nit: var doWait = function() {...}; [1] https://g
jdufault 2016/05/20 21:31:06 Done.
219 var element = $(id);
220 if (!element || !element.offsetHeight) {
221 setTimeout(doWait, 0);
222 return;
223 }
224
225 callback(element);
226 }
227
228 setTimeout(doWait, 0);
xiyuan 2016/05/20 21:06:32 nit: Would window.requestAnimationFrame be better
jdufault 2016/05/20 21:31:06 Makes sense. Done.
229 }
230
211 return { 231 return {
212 alreadyLoadedAssets: alreadyLoadedAssets, 232 alreadyLoadedAssets: alreadyLoadedAssets,
213 hasDeferredAssets: hasDeferredAssets, 233 hasDeferredAssets: hasDeferredAssets,
214 loadAssets: loadAssets, 234 loadAssets: loadAssets,
215 loadAssetsOnIdle: loadAssetsOnIdle, 235 loadAssetsOnIdle: loadAssetsOnIdle,
236 waitUntilLayoutComplete: waitUntilLayoutComplete,
216 registerAssets: registerAssets 237 registerAssets: registerAssets
217 }; 238 };
218 }); 239 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/login/lock.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698