Chromium Code Reviews| 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..7050a2cd05d9a8564c4658da6c5c11467f8b3389 |
| --- /dev/null |
| +++ b/ui/login/login_ui_tools.js |
| @@ -0,0 +1,31 @@ |
| +// 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', function() { |
| + |
| + 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.
|
| + } |
| + |
| + /** |
| + * Computes max-height for an element so that it doesn't overlap shelf. |
| + * @param {element} DOM element |
| + */ |
| + LoginUiTools.getMaxHeightBeforeShelfOverlapping = function(element) { |
| + var maxAllowedHeight = |
| + $('outer-container').offsetHeight - |
| + element.getBoundingClientRect().top - |
| + parseInt(window.getComputedStyle(element).marginTop) - |
| + parseInt(window.getComputedStyle(element).marginBottom); |
| + return maxAllowedHeight; |
| + }; |
| + |
| + // Export |
| + return { |
| + LoginUiTools: LoginUiTools |
| + }; |
| +}); |