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

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

Issue 895283002: Fix Closure Compilation for chrome://downloads and chrome://history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Node -> Element Created 5 years, 10 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 | « chrome/browser/resources/downloads/downloads.js ('k') | ui/webui/resources/js/cr/ui/focus_row.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/focus_grid.js
diff --git a/ui/webui/resources/js/cr/ui/focus_grid.js b/ui/webui/resources/js/cr/ui/focus_grid.js
index 4ff1635f06f3fce2e1bd2757a03a34204372010e..94efc9a196849d1e8bbc7f38f8d5d941ea06316f 100644
--- a/ui/webui/resources/js/cr/ui/focus_grid.js
+++ b/ui/webui/resources/js/cr/ui/focus_grid.js
@@ -43,6 +43,7 @@ cr.define('cr.ui', function() {
* Row delegate to overwrite the behavior of a mouse click to deselect any row
* that wasn't clicked.
* @param {cr.ui.FocusGrid} focusGrid
+ * @constructor
* @implements {cr.ui.FocusRow.Delegate}
*/
FocusGrid.RowDelegate = function(focusGrid) {
@@ -61,8 +62,9 @@ cr.define('cr.ui', function() {
return false;
// Only the clicked row should be active.
+ var target = assertInstanceof(e.target, Node);
this.focusGrid_.rows.forEach(function(row) {
- row.makeRowActive(row.contains(e.target));
+ row.makeRowActive(row.contains(target));
});
e.preventDefault();
@@ -80,7 +82,7 @@ cr.define('cr.ui', function() {
},
/**
- * @param {EventTarget} target A target item to find in this grid.
+ * @param {Node} target A target item to find in this grid.
* @return {number} The row index. -1 if not found.
*/
getRowIndexForTarget: function(target) {
@@ -97,7 +99,8 @@ cr.define('cr.ui', function() {
* @private
*/
onKeydown_: function(e) {
- var rowIndex = this.getRowIndexForTarget(e.target);
+ var target = assertInstanceof(e.target, Node);
+ var rowIndex = this.getRowIndexForTarget(target);
if (rowIndex == -1)
return;
@@ -122,7 +125,7 @@ cr.define('cr.ui', function() {
/**
* Keep track of the last column that the user manually focused.
- * @param {Event} The focusin event.
+ * @param {Event} e The focusin event.
* @private
*/
onFocusin_: function(e) {
@@ -131,8 +134,9 @@ cr.define('cr.ui', function() {
return;
}
- if (this.getRowIndexForTarget(e.target) != -1)
- this.lastFocused = e.target;
+ var target = assertInstanceof(e.target, Node);
+ if (this.getRowIndexForTarget(target) != -1)
+ this.lastFocused = target;
},
/**
« no previous file with comments | « chrome/browser/resources/downloads/downloads.js ('k') | ui/webui/resources/js/cr/ui/focus_row.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698