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

Side by Side Diff: ui/webui/resources/js/chromeos/ui_account_tweaks.js

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well Created 4 years 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 | « ui/webui/resources/js/assert.js ('k') | ui/webui/resources/js/cr.js » ('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 (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 /** 5 /**
6 * @fileoverview This file contains methods that allow to tweak 6 * @fileoverview This file contains methods that allow to tweak
7 * internal page UI based on the status of current user (owner/user/guest). 7 * internal page UI based on the status of current user (owner/user/guest).
8 * It is assumed that required data is passed via i18n strings 8 * It is assumed that required data is passed via i18n strings
9 * (using loadTimeData dictionary) that are filled with call to 9 * (using loadTimeData dictionary) that are filled with call to
10 * AddAccountUITweaksLocalizedValues in ui_account_tweaks.cc. 10 * AddAccountUITweaksLocalizedValues in ui_account_tweaks.cc.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 * @param {!Element} element Element that should be disabled. 159 * @param {!Element} element Element that should be disabled.
160 * @param {string} sessionType account session Type specificator. 160 * @param {string} sessionType account session Type specificator.
161 */ 161 */
162 UIAccountTweaks.disableElementForSessionType_ = function( 162 UIAccountTweaks.disableElementForSessionType_ = function(
163 element, sessionType) { 163 element, sessionType) {
164 element.classList.add(sessionType + '-disabled'); 164 element.classList.add(sessionType + '-disabled');
165 if (element.nodeName == 'INPUT' || element.nodeName == 'SELECT' || 165 if (element.nodeName == 'INPUT' || element.nodeName == 'SELECT' ||
166 element.nodeName == 'BUTTON') { 166 element.nodeName == 'BUTTON') {
167 element.disabled = true; 167 element.disabled = true;
168 } else if (element.nodeName == 'A') { 168 } else if (element.nodeName == 'A') {
169 element.onclick = function() { return false; }; 169 element.onclick = function() {
170 return false;
171 };
170 } 172 }
171 }; 173 };
172 174
173 // Export 175 // Export
174 return {UIAccountTweaks: UIAccountTweaks}; 176 return {UIAccountTweaks: UIAccountTweaks};
175 177
176 }); 178 });
OLDNEW
« no previous file with comments | « ui/webui/resources/js/assert.js ('k') | ui/webui/resources/js/cr.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698