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

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 11194047: Simplify onclick action code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
« 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 (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 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 var ArrayDataModel = cr.ui.ArrayDataModel; 7 var ArrayDataModel = cr.ui.ArrayDataModel;
8 var RepeatingButton = cr.ui.RepeatingButton; 8 var RepeatingButton = cr.ui.RepeatingButton;
9 9
10 // 10 //
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 // TODO(estade): can this just be textContent? 634 // TODO(estade): can this just be textContent?
635 $('sync-status-text').innerHTML = syncData.statusText; 635 $('sync-status-text').innerHTML = syncData.statusText;
636 var statusSet = syncData.statusText.length != 0; 636 var statusSet = syncData.statusText.length != 0;
637 $('sync-overview').hidden = statusSet; 637 $('sync-overview').hidden = statusSet;
638 $('sync-status').hidden = !statusSet; 638 $('sync-status').hidden = !statusSet;
639 639
640 $('sync-action-link').textContent = syncData.actionLinkText; 640 $('sync-action-link').textContent = syncData.actionLinkText;
641 $('sync-action-link').hidden = syncData.actionLinkText.length == 0; 641 $('sync-action-link').hidden = syncData.actionLinkText.length == 0;
642 $('sync-action-link').disabled = syncData.managed; 642 $('sync-action-link').disabled = syncData.managed;
643 643
644 if (cr.isChromeOS && syncData.hasError) { 644 // On Chrome OS, sign out the user and sign in again to get fresh
645 // On Chrome OS, sign out the user and sign in again to get fresh 645 // credentials on auth errors.
646 // credentials on auth errors. 646 $('sync-action-link').onclick = function(event) {
647 $('sync-action-link').onclick = function(event) { 647 if (cr.isChromeOS && syncData.hasError) {
648 SyncSetupOverlay.doSignOutOnAuthError(); 648 SyncSetupOverlay.doSignOutOnAuthError();
649 }; 649 } else {
Evan Stade 2012/10/18 23:35:41 no curlies
kochi 2012/10/19 01:10:27 Done.
650 } else {
651 $('sync-action-link').onclick = function(event) {
652 SyncSetupOverlay.showErrorUI(); 650 SyncSetupOverlay.showErrorUI();
653 }; 651 }
654 } 652 };
655 653
656 if (syncData.hasError) 654 if (syncData.hasError)
657 $('sync-status').classList.add('sync-error'); 655 $('sync-status').classList.add('sync-error');
658 else 656 else
659 $('sync-status').classList.remove('sync-error'); 657 $('sync-status').classList.remove('sync-error');
660 658
661 $('customize-sync').disabled = syncData.hasUnrecoverableError; 659 $('customize-sync').disabled = syncData.hasUnrecoverableError;
662 // Move #enable-auto-login-checkbox to a different location on CrOS. 660 // Move #enable-auto-login-checkbox to a different location on CrOS.
663 if (cr.isChromeOs) { 661 if (cr.isChromeOs) {
664 $('sync-general').insertBefore($('sync-status').nextSibling, 662 $('sync-general').insertBefore($('sync-status').nextSibling,
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 BrowserOptions.getLoggedInUsername = function() { 1337 BrowserOptions.getLoggedInUsername = function() {
1340 return BrowserOptions.getInstance().username_; 1338 return BrowserOptions.getInstance().username_;
1341 }; 1339 };
1342 } 1340 }
1343 1341
1344 // Export 1342 // Export
1345 return { 1343 return {
1346 BrowserOptions: BrowserOptions 1344 BrowserOptions: BrowserOptions
1347 }; 1345 };
1348 }); 1346 });
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