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

Unified Diff: ui/login/login_ui_tools.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.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
new file mode 100644
index 0000000000000000000000000000000000000000..1daf6854674e8f7f4c333dbb1b42504033261bea
--- /dev/null
+++ b/ui/login/login_ui_tools.js
@@ -0,0 +1,24 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview JS helpers used on login.
+ */
+
+cr.define('cr.ui.LoginUITools', function() {
+ return {
+ /**
+ * Computes max-height for an element so that it doesn't overlap shelf.
+ * @param {element} DOM element
+ */
+ getMaxHeightBeforeShelfOverlapping : function(element) {
+ var maxAllowedHeight =
+ $('outer-container').offsetHeight -
+ element.getBoundingClientRect().top -
+ parseInt(window.getComputedStyle(element).marginTop) -
+ parseInt(window.getComputedStyle(element).marginBottom);
+ return maxAllowedHeight;
+ }
+ }
+});
« no previous file with comments | « ui/login/account_picker/user_pod_row.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698