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

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

Issue 543863002: Typecheck chrome://bookmarks using Closure Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@true_master
Patch Set: revert checker.py Created 6 years, 3 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
Index: ui/webui/resources/js/cr/ui/context_menu_button.js
diff --git a/ui/webui/resources/js/cr/ui/context_menu_button.js b/ui/webui/resources/js/cr/ui/context_menu_button.js
index 7d324e3ce0fde81f7e45aac4e434ca55edb84bbf..700cb416b5124f73e55b7eb7e8f554e76f79f239 100644
--- a/ui/webui/resources/js/cr/ui/context_menu_button.js
+++ b/ui/webui/resources/js/cr/ui/context_menu_button.js
@@ -13,14 +13,15 @@ cr.define('cr.ui', function() {
/**
* Helper function for ContextMenuButton to find the first ancestor of the
* button that has a context menu.
- * @param {!MenuButton} el The button to start the search from.
+ * @param {!cr.ui.MenuButton} button The button to start the search from.
* @return {HTMLElement} The found element or null if not found.
*/
- function getContextMenuTarget(el) {
+ function getContextMenuTarget(button) {
+ var el = button;
do {
el = el.parentNode;
} while (el && !('contextMenu' in el));
- return el;
+ return assertInstanceof(el, HTMLElement);
Dan Beam 2014/09/23 02:46:56 what happens when el is null?
Vitaly Pavlenko 2014/09/23 22:20:55 Done.
}
/**
@@ -28,7 +29,7 @@ cr.define('cr.ui', function() {
* ancestor that has a {@code contextMenu} property.
* @param {Object=} opt_propertyBag Optional properties.
* @constructor
- * @extends {MenuButton}
+ * @extends {cr.ui.MenuButton}
*/
var ContextMenuButton = cr.ui.define('button');
@@ -80,7 +81,7 @@ cr.define('cr.ui', function() {
var self = this;
window.setTimeout(function() {
MenuButton.prototype.showMenu.call(self, shouldSetFocus);
- });
+ }, 0);
}
};

Powered by Google App Engine
This is Rietveld 408576698