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

Unified 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: Add semicolon 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/login/lock.js ('k') | no next file » | 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 726fcf80d51b7fed879e4ca243d555fa97067117..4eb6cf302b040518ebc43c1569c072ed08f5bce3 100644
--- a/ui/login/resource_loader.js
+++ b/ui/login/resource_loader.js
@@ -208,11 +208,32 @@ 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 {function()} callback Function to invoke when done loading.
+ */
+ function waitUntilLayoutComplete(id, callback) {
+ var doWait = function() {
+ var element = $(id);
+ if (!element || !element.offsetHeight) {
+ requestAnimationFrame(doWait);
+ return;
+ }
+
+ callback(element);
+ };
+
+ requestAnimationFrame(doWait);
+ }
+
return {
alreadyLoadedAssets: alreadyLoadedAssets,
hasDeferredAssets: hasDeferredAssets,
loadAssets: loadAssets,
loadAssetsOnIdle: loadAssetsOnIdle,
+ waitUntilLayoutComplete: waitUntilLayoutComplete,
registerAssets: registerAssets
};
});
« 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