| 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;
|
|
|