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

Side by Side Diff: chrome/browser/resources/chromeos/login/login_common.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 Common OOBE controller methods. 6 * @fileoverview Common OOBE controller methods.
7 */ 7 */
8 8
9 <include src="../../login/screen.js"></include> 9 <include src="../../login/screen.js"></include>
10 <include src="screen_context.js"></include> 10 <include src="screen_context.js"></include>
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 /** 321 /**
322 * Sets the current size of the client area (display size). 322 * Sets the current size of the client area (display size).
323 * @param {number} width client area width 323 * @param {number} width client area width
324 * @param {number} height client area height 324 * @param {number} height client area height
325 */ 325 */
326 Oobe.setClientAreaSize = function(width, height) { 326 Oobe.setClientAreaSize = function(width, height) {
327 Oobe.getInstance().setClientAreaSize(width, height); 327 Oobe.getInstance().setClientAreaSize(width, height);
328 }; 328 };
329 329
330 /**
331 * Computes max-height for an element so that it doesn't overlap shelf.
332 * @param {element} DOM element
333 */
334 Oobe.getMaxHeightBeforeShelfOverlapping = function(element) {
335 var maxAllowedHeight =
336 parseInt(window.getComputedStyle($('outer-container')).height) -
337 element.getBoundingClientRect().top -
338 parseInt(window.getComputedStyle(element).marginTop) -
339 parseInt(window.getComputedStyle(element).marginBottom) -
340 parseInt(window.getComputedStyle(element).paddingTop) -
341 parseInt(window.getComputedStyle(element).paddingBottom);
342 return maxAllowedHeight;
dzhioev (left Google) 2014/07/16 19:13:50 I don't like this approach. It has many problems:
merkulova 2014/07/22 08:11:44 Done.
343 }
344
330 // Export 345 // Export
331 return { 346 return {
332 Oobe: Oobe 347 Oobe: Oobe
333 }; 348 };
334 }); 349 });
335 350
336 var Oobe = cr.ui.Oobe; 351 var Oobe = cr.ui.Oobe;
337 352
338 // Allow selection events on components with editable text (password field) 353 // Allow selection events on components with editable text (password field)
339 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) 354 // bug (http://code.google.com/p/chromium/issues/detail?id=125863)
(...skipping 21 matching lines...) Expand all
361 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() { 376 cr.ui.login.ResourceLoader.loadAssets(SCREEN_OOBE_ENROLLMENT, function() {
362 // This screen is async-loaded so we manually trigger i18n processing. 377 // This screen is async-loaded so we manually trigger i18n processing.
363 i18nTemplate.process($('oauth-enrollment'), loadTimeData); 378 i18nTemplate.process($('oauth-enrollment'), loadTimeData);
364 // Delayed binding since this isn't defined yet. 379 // Delayed binding since this isn't defined yet.
365 login.OAuthEnrollmentScreen.register(); 380 login.OAuthEnrollmentScreen.register();
366 }); 381 });
367 382
368 // Delayed binding since this isn't defined yet. 383 // Delayed binding since this isn't defined yet.
369 cr.ui.Oobe.initialize(); 384 cr.ui.Oobe.initialize();
370 }); 385 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698