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

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

Issue 2597013002: Run clang-format on ui/webui/resources (Closed)
Patch Set: remove cr_shared_menu.js Created 4 years 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/menu.js
diff --git a/ui/webui/resources/js/cr/ui/menu.js b/ui/webui/resources/js/cr/ui/menu.js
index fbf0522c48b1466fe1004491e1bee3ba15f5548b..cac465dad40517dc4eab007aced067806ba5f4a3 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -77,9 +77,7 @@ cr.define('cr.ui', function() {
/**
* Clears menu.
*/
- clear: function() {
- this.textContent = '';
- },
+ clear: function() { this.textContent = ''; },
/**
* Walks up the ancestors of |node| until a menu item belonging to this menu
@@ -101,7 +99,7 @@ cr.define('cr.ui', function() {
* @private
*/
handleMouseOver_: function(e) {
- var overItem = this.findMenuItem_(/** @type {Element} */(e.target));
+ var overItem = this.findMenuItem_(/** @type {Element} */ (e.target));
this.selectedItem = overItem;
},
@@ -110,9 +108,7 @@ cr.define('cr.ui', function() {
* @param {Event} e The mouseout event.
* @private
*/
- handleMouseOut_: function(e) {
- this.selectedItem = null;
- },
+ handleMouseOut_: function(e) { this.selectedItem = null; },
/**
* If there's a mouseup that happens quickly in about the same position,
@@ -122,7 +118,7 @@ cr.define('cr.ui', function() {
* @private
*/
handleMouseUp_: function(e) {
- assert(this.contains(/** @type {Element} */(e.target)));
+ assert(this.contains(/** @type {Element} */ (e.target)));
if (!this.trustEvent_(e) || Date.now() - this.shown_.time > 200)
return;
@@ -141,9 +137,7 @@ cr.define('cr.ui', function() {
* @private
* @suppress {checkTypes}
*/
- trustEvent_: function(e) {
- return e.isTrusted || e.isTrustedForTesting;
- },
+ trustEvent_: function(e) { return e.isTrusted || e.isTrustedForTesting; },
get menuItems() {
return this.querySelectorAll(this.menuItemSelector || '*');
@@ -153,9 +147,7 @@ cr.define('cr.ui', function() {
* The selected menu item or null if none.
* @type {cr.ui.MenuItem}
*/
- get selectedItem() {
- return this.menuItems[this.selectedIndex];
- },
+ get selectedItem() { return this.menuItems[this.selectedIndex]; },
set selectedItem(item) {
var index = Array.prototype.indexOf.call(this.menuItems, item);
this.selectedIndex = index;
@@ -180,9 +172,7 @@ cr.define('cr.ui', function() {
/**
* Menu length
*/
- get length() {
- return this.menuItems.length;
- },
+ get length() { return this.menuItems.length; },
/**
* Returns if the menu has any visible item.
@@ -310,8 +300,8 @@ cr.define('cr.ui', function() {
* The selected menu item.
* type {number}
*/
- cr.defineProperty(Menu, 'selectedIndex', cr.PropertyKind.JS,
- selectedIndexChanged);
+ cr.defineProperty(
+ Menu, 'selectedIndex', cr.PropertyKind.JS, selectedIndexChanged);
/**
* Selector for children which are menu items.
@@ -319,7 +309,5 @@ cr.define('cr.ui', function() {
cr.defineProperty(Menu, 'menuItemSelector', cr.PropertyKind.ATTR);
// Export
- return {
- Menu: Menu
- };
+ return {Menu: Menu};
});

Powered by Google App Engine
This is Rietveld 408576698