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

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: Added a comment. 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
« no previous file with comments | « ui/login/account_picker/user_pod_template.html ('k') | ui/login/screen_container.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/resource_loader.js
diff --git a/ui/login/resource_loader.js b/ui/login/resource_loader.js
index 56a68353cf9dbf8aefbcdcaf98813a207ca0817a..d4e59371583a1454333bfe21b914d7bf20e3c5f3 100644
--- a/ui/login/resource_loader.js
+++ b/ui/login/resource_loader.js
@@ -213,12 +213,19 @@ cr.define('cr.ui.login.ResourceLoader', function() {
/**
* Wait until the element with the given |id| has finished its layout,
* specifically, after it has an offsetHeight > 0.
- * @param {string} id Identifier of the element to wait for.
+ * @param {string|function()} selector Identifier of the element to wait
+ * or a callback function to obtain element to wait for.
* @param {function()} callback Function to invoke when done loading.
*/
- function waitUntilLayoutComplete(id, callback) {
+ function waitUntilLayoutComplete(selector, callback) {
+ if (typeof selector == 'string') {
+ var id = selector;
+ selector = function() { return $(id) };
+ }
+
var doWait = function() {
- var element = $(id);
+ var element = selector();
+
if (!element || !element.offsetHeight) {
requestAnimationFrame(doWait);
return;
« no previous file with comments | « ui/login/account_picker/user_pod_template.html ('k') | ui/login/screen_container.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698