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

Unified Diff: ui/webui/resources/js/chromeos/ui_account_tweaks.js

Issue 405743002: Typecheck some of ui/webui/resources/js/ with Closure compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback Created 6 years, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/chromeos/ui_account_tweaks.js
diff --git a/ui/webui/resources/js/chromeos/ui_account_tweaks.js b/ui/webui/resources/js/chromeos/ui_account_tweaks.js
index 9b4b85aef2be1de552a3688bcf88f9a21c2d71b2..515fdf929b1033daf1475d1c8a91ff926f7380a3 100644
--- a/ui/webui/resources/js/chromeos/ui_account_tweaks.js
+++ b/ui/webui/resources/js/chromeos/ui_account_tweaks.js
@@ -109,7 +109,7 @@ cr.define('uiAccountTweaks', function() {
* disables interactive elements (input/select/button), and removes href
* attribute from <a> elements.
*
- * @param {Element} element Root element of DOM subtree that should be
+ * @param {!Element} element Root element of DOM subtree that should be
* disabled.
* @param {string} sessionType session type specificator.
*/
@@ -125,7 +125,10 @@ cr.define('uiAccountTweaks', function() {
var node = walker.nextNode();
while (node) {
- UIAccountTweaks.disableElementForSessionType_(node, sessionType);
+ if (!(node instanceof Element)) {
arv (Not doing code reviews) 2014/07/25 18:27:13 this is always false
Dan Beam 2014/07/25 21:58:18 whoops, removed and changed back to cast
+ UIAccountTweaks.disableElementForSessionType_(
+ /** @type {!Element} */(node), sessionType);
+ }
node = walker.nextNode();
}
};
@@ -137,7 +140,7 @@ cr.define('uiAccountTweaks', function() {
* <a> element.
*
* @private
- * @param {Element} element Element that should be disabled.
+ * @param {!Element} element Element that should be disabled.
* @param {string} sessionType account session Type specificator.
*/
UIAccountTweaks.disableElementForSessionType_ = function(element,
@@ -145,9 +148,9 @@ cr.define('uiAccountTweaks', function() {
element.classList.add(sessionType + '-disabled');
if (element.nodeName == 'INPUT' ||
element.nodeName == 'SELECT' ||
- element.nodeName == 'BUTTON')
+ element.nodeName == 'BUTTON') {
element.disabled = true;
- if (element.nodeName == 'A') {
+ } else if (element.nodeName == 'A') {
element.onclick = function() {
return false;
};
« 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