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

Unified Diff: ui/webui/resources/js/cr/ui/menu.js

Issue 454223004: Typecheck JS files for chrome://history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@B_download
Patch Set: rebase once again Created 6 years, 4 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/cr/ui/focus_row.js ('k') | ui/webui/resources/js/cr/ui/menu_button.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/menu.js
diff --git a/ui/webui/resources/js/cr/ui/menu.js b/ui/webui/resources/js/cr/ui/menu.js
index ea1088783cb6526399d97645c4518ba0d1c0fb0c..6f5a8258db684bdc171d3781c7685aeb303746e6 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -86,17 +86,17 @@ cr.define('cr.ui', function() {
},
/**
- * Walks up the ancestors of |el| until a menu item belonging to this menu
+ * Walks up the ancestors of |node| until a menu item belonging to this menu
* is found.
- * @param {Element} el The element to start searching from.
+ * @param {Node} node The node to start searching from.
* @return {cr.ui.MenuItem} The found menu item or null.
* @private
*/
- findMenuItem_: function(el) {
- while (el && el.parentNode != this) {
- el = el.parentNode;
+ findMenuItem_: function(node) {
+ while (node && node.parentNode != this) {
+ node = node.parentNode;
}
- return el ? assertInstanceof(el, MenuItem) : null;
+ return node ? assertInstanceof(node, MenuItem) : null;
},
/**
@@ -105,7 +105,7 @@ cr.define('cr.ui', function() {
* @private
*/
handleMouseOver_: function(e) {
- var overItem = this.findMenuItem_(e.target);
+ var overItem = this.findMenuItem_(/** @type {Element} */(e.target));
this.selectedItem = overItem;
},
@@ -267,7 +267,7 @@ cr.define('cr.ui', function() {
/**
* The selected menu item.
- * @type {number}
+ * type {number}
*/
cr.defineProperty(Menu, 'selectedIndex', cr.PropertyKind.JS,
selectedIndexChanged);
« no previous file with comments | « ui/webui/resources/js/cr/ui/focus_row.js ('k') | ui/webui/resources/js/cr/ui/menu_button.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698