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

Unified Diff: chrome/browser/resources/login/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: Created 6 years, 5 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
Index: chrome/browser/resources/login/user_pod_row.js
diff --git a/chrome/browser/resources/login/user_pod_row.js b/chrome/browser/resources/login/user_pod_row.js
index 24fdb39d2e63738e83c2acf56c945474b5d73298..1d88e3040330220aa6fe138b53d88840a67da4c1 100644
--- a/chrome/browser/resources/login/user_pod_row.js
+++ b/chrome/browser/resources/login/user_pod_row.js
@@ -373,6 +373,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}
*/
@@ -582,6 +590,8 @@ cr.define('login', function() {
this.actionBoxAreaElement.classList.add('active');
} else {
this.actionBoxAreaElement.classList.remove('active');
+ this.actionBoxAreaElement.classList.remove('menuMovedUp');
+ this.actionBoxMenu.classList.remove('menuMovedUp');
}
},
@@ -832,6 +842,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 = Oobe.getMaxHeightBeforeShelfOverlapping(
+ this.actionBoxMenu);
+ var actualHeight = parseInt(
+ window.getComputedStyle(this.actionBoxMenu).height);
+ if (maxHeight < actualHeight) {
+ this.actionBoxMenu.classList.add('menuMovedUp');
+ this.actionBoxAreaElement.classList.add('menuMovedUp');
+ }
},
/**

Powered by Google App Engine
This is Rietveld 408576698