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

Unified Diff: ui/login/bubble.js

Issue 2467783002: ChromeOS: update alignment of user POD error bubble. (Closed)
Patch Set: Removed some 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/account_picker/screen_account_picker.js ('K') | « ui/login/bubble.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/bubble.js
diff --git a/ui/login/bubble.js b/ui/login/bubble.js
index 1340f28213b8cf3706e5e4abb6e81bfa8614c727..b17e3d4d30eadcc228b8e63748cd3c426dc95314 100644
--- a/ui/login/bubble.js
+++ b/ui/login/bubble.js
@@ -183,8 +183,8 @@ cr.define('cr.ui', function() {
* @param {number=} opt_padding Optional padding of the bubble.
*/
showContentForElement: function(el, attachment, opt_content,
- opt_offset, opt_padding) {
- /** @const */ var ARROW_OFFSET = 25;
+ opt_offset, opt_padding, opt_match_width) {
+ /** @const */ var ARROW_OFFSET = 0;
/** @const */ var DEFAULT_PADDING = 18;
if (opt_padding == undefined)
@@ -237,6 +237,16 @@ cr.define('cr.ui', function() {
break;
}
}
+ this.style.width = '';
+ this.removeAttribute('match-width');
+ if (opt_match_width) {
+ this.setAttribute('match-width', '');
+ var el_width = window.getComputedStyle(el, null).getPropertyValue('width');
+ var padding_left = parseInt(window.getComputedStyle(this, null).getPropertyValue('padding-left'));
+ var padding_right = parseInt(window.getComputedStyle(this, null).getPropertyValue('padding-right'));
+ if (el_width)
+ this.style.width = (parseInt(el_width) - padding_left - padding_right) + 'px';
+ }
this.anchor_ = el;
this.showContentAt_(pos, opt_content);
« ui/login/account_picker/screen_account_picker.js ('K') | « ui/login/bubble.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698