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

Unified Diff: ui/login/login_ui_tools.js

Issue 2467783002: ChromeOS: update alignment of user POD error bubble. (Closed)
Patch Set: Bugfix. Created 4 years, 1 month 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/bubble.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/login_ui_tools.js
diff --git a/ui/login/login_ui_tools.js b/ui/login/login_ui_tools.js
index 2759ceb7dd62e6badfe49d0476b9a174db7f46fe..d66d64b8c108eeccbe0fd8a7e37247c1f784f38f 100644
--- a/ui/login/login_ui_tools.js
+++ b/ui/login/login_ui_tools.js
@@ -19,10 +19,25 @@ cr.define('cr.ui.LoginUITools', function() {
element.getBoundingClientRect().top -
parseInt(window.getComputedStyle(element).marginTop) -
parseInt(window.getComputedStyle(element).marginBottom);
- if (wholeWindow)
+ if (wholeWindow) {
maxAllowedHeight +=
parseInt(window.getComputedStyle($('outer-container')).bottom);
+ }
return maxAllowedHeight;
- }
+ },
+
+ /**
+ * Computes max-width for an element so that it does fit the
+ * outer-container.
+ * @param {element} DOM element
+ */
+ getMaxWidthToFit : function(element) {
+ var maxAllowedWidth =
+ $('outer-container').offsetWidth -
+ element.getBoundingClientRect().left -
+ parseInt(window.getComputedStyle(element).marginLeft) -
+ parseInt(window.getComputedStyle(element).marginRight);
+ return maxAllowedWidth;
+ },
}
});
« no previous file with comments | « ui/login/bubble.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698