Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @fileoverview JS helpers used on login. | |
| 7 */ | |
| 8 | |
| 9 cr.define('cr.ui', function() { | |
| 10 | |
| 11 function LoginUiTools() { | |
|
dzhioev (left Google)
2014/08/01 16:26:13
LoginUITools shouldn't be a function, object will
dzhioev (left Google)
2014/08/01 16:26:13
nit: 'Ui' looks ugly. I prefer LoginUITools
merkulova
2014/08/04 06:39:29
Done.
merkulova
2014/08/04 06:39:29
Done.
| |
| 12 } | |
| 13 | |
| 14 /** | |
| 15 * Computes max-height for an element so that it doesn't overlap shelf. | |
| 16 * @param {element} DOM element | |
| 17 */ | |
| 18 LoginUiTools.getMaxHeightBeforeShelfOverlapping = function(element) { | |
| 19 var maxAllowedHeight = | |
| 20 $('outer-container').offsetHeight - | |
| 21 element.getBoundingClientRect().top - | |
| 22 parseInt(window.getComputedStyle(element).marginTop) - | |
| 23 parseInt(window.getComputedStyle(element).marginBottom); | |
| 24 return maxAllowedHeight; | |
| 25 }; | |
| 26 | |
| 27 // Export | |
| 28 return { | |
| 29 LoginUiTools: LoginUiTools | |
| 30 }; | |
| 31 }); | |
| OLD | NEW |