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

Unified Diff: ui/login/login_ui_tools.js

Issue 2467783002: ChromeOS: update alignment of user POD error bubble. (Closed)
Patch Set: Implemented side positioning. Removed debug. 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
« ui/login/bubble.js ('K') | « 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..f78cecb82bc5bfe97adc1db272ebd92b37fdd068 100644
--- a/ui/login/login_ui_tools.js
+++ b/ui/login/login_ui_tools.js
@@ -23,6 +23,20 @@ cr.define('cr.ui.LoginUITools', function() {
maxAllowedHeight +=
parseInt(window.getComputedStyle($('outer-container')).bottom);
xiyuan 2016/11/02 16:17:22 unrelated to your change, but could you wrap this
Alexander Alekseev 2016/11/03 01:27:43 Done.
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;
+ },
}
});
« ui/login/bubble.js ('K') | « ui/login/bubble.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698