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 /** | 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 Loading... |
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 }); |
OLD | NEW |