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

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

Issue 2603443002: Clang format JS: Disallow single line functions, conditionals, loops, and switch statements (Closed)
Patch Set: update c/b/r/ as well 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 cac465dad40517dc4eab007aced067806ba5f4a3..82013972ff9578a923f38903b159d1c1ef527053 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -77,7 +77,9 @@ 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
@@ -108,7 +110,9 @@ 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,
@@ -137,7 +141,9 @@ 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 || '*');
@@ -147,7 +153,9 @@ 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;
@@ -172,7 +180,9 @@ 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.
« no previous file with comments | « ui/webui/resources/js/cr/ui/list_single_selection_model.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