| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
| 7 | 7 |
| 8 // Variable to track if a captcha challenge was issued. If this gets set to | 8 // Variable to track if a captcha challenge was issued. If this gets set to |
| 9 // true, it stays that way until we are told about successful login from | 9 // true, it stays that way until we are told about successful login from |
| 10 // the browser. This means subsequent errors (like invalid password) are | 10 // the browser. This means subsequent errors (like invalid password) are |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 501 |
| 502 /** | 502 /** |
| 503 * Shows the appropriate sync setup page. | 503 * Shows the appropriate sync setup page. |
| 504 * @param {string} page A page of the sync setup to show. | 504 * @param {string} page A page of the sync setup to show. |
| 505 * @param {object} args Data from the C++ to forward on to the right | 505 * @param {object} args Data from the C++ to forward on to the right |
| 506 * section. | 506 * section. |
| 507 */ | 507 */ |
| 508 showSyncSetupPage_: function(page, args) { | 508 showSyncSetupPage_: function(page, args) { |
| 509 this.setThrobbersVisible_(false); | 509 this.setThrobbersVisible_(false); |
| 510 | 510 |
| 511 // Hide an existing visible overlay. | 511 // Hide an existing visible overlay (ensuring the close button is not |
| 512 var overlay = $('sync-setup-overlay'); | 512 // hidden). |
| 513 for (var i = 0; i < overlay.children.length; i++) | 513 var children = document.querySelectorAll( |
| 514 overlay.children[i].hidden = true; | 514 '#sync-setup-overlay > *:not(.close-button)'); |
| 515 for (var i = 0; i < children.length; i++) |
| 516 children[i].hidden = true; |
| 515 | 517 |
| 516 this.setInputElementsDisabledState_(false); | 518 this.setInputElementsDisabledState_(false); |
| 517 | 519 |
| 518 // NOTE: Because both showGaiaLogin_() and showConfigure_() change the | 520 // NOTE: Because both showGaiaLogin_() and showConfigure_() change the |
| 519 // focus, we need to ensure that the overlay container and dialog aren't | 521 // focus, we need to ensure that the overlay container and dialog aren't |
| 520 // [hidden] (as trying to focus() nodes inside of a [hidden] DOM section | 522 // [hidden] (as trying to focus() nodes inside of a [hidden] DOM section |
| 521 // doesn't work). | 523 // doesn't work). |
| 522 if (page == 'done') | 524 if (page == 'done') |
| 523 this.closeOverlay_(); | 525 this.closeOverlay_(); |
| 524 else | 526 else |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 | 882 |
| 881 SyncSetupOverlay.showStopSyncingUI = function() { | 883 SyncSetupOverlay.showStopSyncingUI = function() { |
| 882 SyncSetupOverlay.getInstance().showStopSyncingUI_(); | 884 SyncSetupOverlay.getInstance().showStopSyncingUI_(); |
| 883 }; | 885 }; |
| 884 | 886 |
| 885 // Export | 887 // Export |
| 886 return { | 888 return { |
| 887 SyncSetupOverlay: SyncSetupOverlay | 889 SyncSetupOverlay: SyncSetupOverlay |
| 888 }; | 890 }; |
| 889 }); | 891 }); |
| OLD | NEW |