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

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

Issue 2817743002: Sync confirmation: Enter on paper-checkbox shouldn't confirm dialog (Closed)
Patch Set: Created 3 years, 8 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 | 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 2015 The Chromium Authors. All rights reserved. 1 /* Copyright 2015 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('sync.confirmation', function() { 5 cr.define('sync.confirmation', function() {
6 'use strict'; 6 'use strict';
7 7
8 function onConfirm(e) { 8 function onConfirm(e) {
9 chrome.send('confirm', [$('configure-before-signing-in').checked]); 9 chrome.send('confirm', [$('configure-before-signing-in').checked]);
10 } 10 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (loadTimeData.getBoolean('isSyncAllowed')) { 45 if (loadTimeData.getBoolean('isSyncAllowed')) {
46 $('picture-container').classList.add('loaded'); 46 $('picture-container').classList.add('loaded');
47 } 47 }
48 } 48 }
49 49
50 function onKeyDown(e) { 50 function onKeyDown(e) {
51 // If the currently focused element isn't something that performs an action 51 // If the currently focused element isn't something that performs an action
52 // on "enter" being pressed and the user hits "enter", perform the default 52 // on "enter" being pressed and the user hits "enter", perform the default
53 // action of the dialog, which is "OK, Got It". 53 // action of the dialog, which is "OK, Got It".
54 if (e.key == 'Enter' && 54 if (e.key == 'Enter' &&
55 !/^(A|PAPER-BUTTON)$/.test(document.activeElement.tagName)) { 55 !/^(A|PAPER-(BUTTON|CHECKBOX))$/.test(document.activeElement.tagName)) {
56 $('confirmButton').click(); 56 $('confirmButton').click();
57 e.preventDefault(); 57 e.preventDefault();
58 } 58 }
59 } 59 }
60 60
61 return { 61 return {
62 clearFocus: clearFocus, 62 clearFocus: clearFocus,
63 initialize: initialize, 63 initialize: initialize,
64 setUserImageURL: setUserImageURL 64 setUserImageURL: setUserImageURL
65 }; 65 };
66 }); 66 });
67 67
68 document.addEventListener('DOMContentLoaded', sync.confirmation.initialize); 68 document.addEventListener('DOMContentLoaded', sync.confirmation.initialize);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698