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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 399613002: Anti-shelf-overlapping fixes for several menus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Css fixes intersecting with another CL removed. Created 6 years, 4 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 | « ui/login/account_picker/user_pod_row.css ('k') | ui/login/login_ui_tools.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/account_picker/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index 635a7f6f7e2b97edcc423aa6b06701c31cd035ac..db04a8a274d2059689661df6e99cc07f0cce6ae6 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -367,6 +367,14 @@ cr.define('login', function() {
},
/**
+ * Gets action box menu.
+ * @type {!HTMLInputElement}
+ */
+ get actionBoxMenu() {
+ return this.querySelector('.action-box-menu');
+ },
+
+ /**
* Gets action box menu title, user name item.
* @type {!HTMLInputElement}
*/
@@ -575,6 +583,8 @@ cr.define('login', function() {
this.actionBoxAreaElement.classList.add('active');
} else {
this.actionBoxAreaElement.classList.remove('active');
+ this.actionBoxAreaElement.classList.remove('menu-moved-up');
+ this.actionBoxMenu.classList.remove('menu-moved-up');
}
},
@@ -716,6 +726,17 @@ cr.define('login', function() {
error,
this.signinButtonElement.offsetWidth / 2,
4);
+ // Move warning bubble up if it overlaps the shelf.
+ var maxHeight =
+ cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble'));
+ if (maxHeight < $('bubble').offsetHeight) {
+ $('bubble').showContentForElement(
+ this.signinButtonElement,
+ cr.ui.Bubble.Attachment.BOTTOM,
+ error,
+ this.signinButtonElement.offsetWidth / 2,
+ 4);
+ }
},
/**
@@ -825,6 +846,16 @@ cr.define('login', function() {
this.actionBoxMenuRemoveElement.hidden = true;
this.actionBoxRemoveUserWarningElement.hidden = false;
this.actionBoxRemoveUserWarningButtonElement.focus();
+
+ // Move up the menu if it overlaps shelf.
+ var maxHeight = cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping(
+ this.actionBoxMenu);
+ var actualHeight = parseInt(
+ window.getComputedStyle(this.actionBoxMenu).height);
+ if (maxHeight < actualHeight) {
+ this.actionBoxMenu.classList.add('menu-moved-up');
+ this.actionBoxAreaElement.classList.add('menu-moved-up');
+ }
},
/**
« no previous file with comments | « ui/login/account_picker/user_pod_row.css ('k') | ui/login/login_ui_tools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698