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

Side by Side Diff: chrome/browser/resources/signin/signin_error/signin_error.js

Issue 2672433002: Fix layout of the sync and sign-in error dialogs when the page zoom is increased. (Closed)
Patch Set: Fix layout of the sync and sign-in error dialogs when the page zoom is increased. Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/resources/signin/signin_shared_css.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright 2016 The Chromium Authors. All rights reserved. 1 /* Copyright 2016 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 cr.define('signin.error', function() { 5 cr.define('signin.error', function() {
6 'use strict'; 6 'use strict';
7 7
8 function initialize() { 8 function initialize() {
9 document.addEventListener('keydown', onKeyDown); 9 document.addEventListener('keydown', onKeyDown);
10 $('confirmButton').addEventListener('click', onConfirm); 10 $('confirmButton').addEventListener('click', onConfirm);
11 $('closeButton').addEventListener('click', onConfirm); 11 $('closeButton').addEventListener('click', onConfirm);
12 $('switchButton').addEventListener('click', onSwitchToExistingProfile); 12 $('switchButton').addEventListener('click', onSwitchToExistingProfile);
13 $('learnMoreLink').addEventListener('click', onLearnMore); 13 $('learnMoreLink').addEventListener('click', onLearnMore);
14 if (loadTimeData.getBoolean('isSystemProfile')) { 14 if (loadTimeData.getBoolean('isSystemProfile')) {
15 $('learnMoreLink').hidden = true; 15 $('learnMoreLink').hidden = true;
16 } 16 }
17 chrome.send('initializedWithSize', [document.body.scrollHeight]); 17
18 // Prefer using |document.body.offsetHeight| instead of
19 // |document.body.scrollHeight| as it returns the correct height of the
20 // even when the page zoom in Chrome is different than 100%.
21 chrome.send('initializedWithSize', [document.body.offsetHeight]);
18 } 22 }
19 23
20 function onKeyDown(e) { 24 function onKeyDown(e) {
21 // If the currently focused element isn't something that performs an action 25 // If the currently focused element isn't something that performs an action
22 // on "enter" being pressed and the user hits "enter", perform the default 26 // on "enter" being pressed and the user hits "enter", perform the default
23 // action of the dialog, which is "OK". 27 // action of the dialog, which is "OK".
24 if (e.key == 'Enter' && 28 if (e.key == 'Enter' &&
25 !/^(A|PAPER-BUTTON)$/.test(document.activeElement.tagName)) { 29 !/^(A|PAPER-BUTTON)$/.test(document.activeElement.tagName)) {
26 $('confirmButton').click(); 30 $('confirmButton').click();
27 e.preventDefault(); 31 e.preventDefault();
(...skipping 23 matching lines...) Expand all
51 } 55 }
52 56
53 return { 57 return {
54 initialize: initialize, 58 initialize: initialize,
55 clearFocus: clearFocus, 59 clearFocus: clearFocus,
56 removeSwitchButton: removeSwitchButton 60 removeSwitchButton: removeSwitchButton
57 }; 61 };
58 }); 62 });
59 63
60 document.addEventListener('DOMContentLoaded', signin.error.initialize); 64 document.addEventListener('DOMContentLoaded', signin.error.initialize);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/signin/signin_shared_css.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698