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

Side by Side Diff: ui/login/login_ui_tools.js

Issue 2467783002: ChromeOS: update alignment of user POD error bubble. (Closed)
Patch Set: Update after review 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 unified diff | Download patch
« ui/login/bubble.js ('K') | « ui/login/bubble.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview JS helpers used on login. 6 * @fileoverview JS helpers used on login.
7 */ 7 */
8 8
9 cr.define('cr.ui.LoginUITools', function() { 9 cr.define('cr.ui.LoginUITools', function() {
10 return { 10 return {
11 /** 11 /**
12 * Computes max-height for an element so that it doesn't overlap shelf. 12 * Computes max-height for an element so that it doesn't overlap shelf.
13 * @param {element} DOM element 13 * @param {element} DOM element
14 * @param {wholeWindow} Whether the element can go outside outer-container. 14 * @param {wholeWindow} Whether the element can go outside outer-container.
15 */ 15 */
16 getMaxHeightBeforeShelfOverlapping : function(element, wholeWindow) { 16 getMaxHeightBeforeShelfOverlapping : function(element, wholeWindow) {
17 var maxAllowedHeight = 17 var maxAllowedHeight =
18 $('outer-container').offsetHeight - 18 $('outer-container').offsetHeight -
19 element.getBoundingClientRect().top - 19 element.getBoundingClientRect().top -
20 parseInt(window.getComputedStyle(element).marginTop) - 20 parseInt(window.getComputedStyle(element).marginTop) -
21 parseInt(window.getComputedStyle(element).marginBottom); 21 parseInt(window.getComputedStyle(element).marginBottom);
22 if (wholeWindow) 22 if (wholeWindow) {
23 maxAllowedHeight += 23 maxAllowedHeight +=
24 parseInt(window.getComputedStyle($('outer-container')).bottom); 24 parseInt(window.getComputedStyle($('outer-container')).bottom);
25 }
25 return maxAllowedHeight; 26 return maxAllowedHeight;
26 } 27 },
28
29 /**
30 * Computes max-width for an element so that it does fit the
31 * outer-container.
32 * @param {element} DOM element
33 */
34 getMaxWidthToFit : function(element) {
35 var maxAllowedWidth =
36 $('outer-container').offsetWidth -
37 element.getBoundingClientRect().left -
38 parseInt(window.getComputedStyle(element).marginLeft) -
39 parseInt(window.getComputedStyle(element).marginRight);
40 return maxAllowedWidth;
41 },
27 } 42 }
28 }); 43 });
OLDNEW
« 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