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

Unified 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 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/login/resource_loader.js
diff --git a/ui/login/resource_loader.js b/ui/login/resource_loader.js
index 56a68353cf9dbf8aefbcdcaf98813a207ca0817a..663d14384579640160d3ccf211078557168d2dbd 100644
--- a/ui/login/resource_loader.js
+++ b/ui/login/resource_loader.js
@@ -216,9 +216,18 @@ cr.define('cr.ui.login.ResourceLoader', function() {
* @param {string} id Identifier of the element to wait for.
jdufault 2016/06/23 19:51:15 Update docs.
sammiequon 2016/06/24 18:07:55 Done.
* @param {function()} callback Function to invoke when done loading.
*/
- function waitUntilLayoutComplete(id, callback) {
+ function waitUntilLayoutComplete(selector, callback) {
+ var type = typeof selector;
+ if (type != 'string' && type != 'function')
jdufault 2016/06/23 19:51:15 Crashing is typically better than silently failing
sammiequon 2016/06/24 18:07:55 Done.
+ return;
+
var doWait = function() {
- var element = $(id);
+ var element;
+ if (type == 'string')
jdufault 2016/06/23 19:51:15 Alternatively, you could make selector always be a
sammiequon 2016/06/24 18:07:55 Done.
+ element = $(selector);
+ else
+ element = selector();
+
if (!element || !element.offsetHeight) {
requestAnimationFrame(doWait);
return;

Powered by Google App Engine
This is Rietveld 408576698