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

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

Issue 2027683003: Pin keyboard moved to under the user profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed patch set 6 errors. Created 4 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 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 /** 213 /**
214 * Wait until the element with the given |id| has finished its layout, 214 * Wait until the element with the given |id| has finished its layout,
215 * specifically, after it has an offsetHeight > 0. 215 * specifically, after it has an offsetHeight > 0.
216 * @param {string} id Identifier of the element to wait for. 216 * @param {string} id Identifier of the element to wait for.
217 * @param {function()} callback Function to invoke when done loading. 217 * @param {function()} callback Function to invoke when done loading.
218 */ 218 */
219 function waitUntilLayoutComplete(id, callback) { 219 function waitUntilLayoutComplete(id, callback) {
220 var doWait = function() { 220 var doWait = function() {
221 var element = $(id); 221 var element = document.getElementsByClassName(id)[0];
jdufault 2016/06/23 00:02:31 How about this: - Rename id to selector - If sele
sammiequon 2016/06/23 19:23:21 Done.
222 if (!element || !element.offsetHeight) { 222 if (!element || !element.offsetHeight) {
223 requestAnimationFrame(doWait); 223 requestAnimationFrame(doWait);
224 return; 224 return;
225 } 225 }
226 226
227 callback(element); 227 callback();
jdufault 2016/06/23 00:02:32 ?
sammiequon 2016/06/23 19:23:21 Done.
228 }; 228 };
229 229
230 requestAnimationFrame(doWait); 230 requestAnimationFrame(doWait);
231 } 231 }
232 232
233 return { 233 return {
234 alreadyLoadedAssets: alreadyLoadedAssets, 234 alreadyLoadedAssets: alreadyLoadedAssets,
235 hasDeferredAssets: hasDeferredAssets, 235 hasDeferredAssets: hasDeferredAssets,
236 loadAssets: loadAssets, 236 loadAssets: loadAssets,
237 loadAssetsOnIdle: loadAssetsOnIdle, 237 loadAssetsOnIdle: loadAssetsOnIdle,
238 waitUntilLayoutComplete: waitUntilLayoutComplete, 238 waitUntilLayoutComplete: waitUntilLayoutComplete,
239 registerAssets: registerAssets 239 registerAssets: registerAssets
240 }; 240 };
241 }); 241 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698