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

Unified Diff: ui/webui/resources/cr_elements/cr_action_menu/cr_action_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/cr_elements/cr_action_menu/cr_action_menu.js
diff --git a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
index 51c87e5554bed1f9fc8ee816da312e70a81cc0dc..7b912faa76c465bdbc652399fb4f87ce2692d447 100644
--- a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
+++ b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
@@ -41,9 +41,7 @@ Polymer({
},
/** override */
- detached: function() {
- this.removeResizeListener_();
- },
+ detached: function() { this.removeResizeListener_(); },
/** @private */
removeResizeListener_: function() {
@@ -75,7 +73,7 @@ Polymer({
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp')
return;
- var nextOption = this.getNextOption_(e.key == 'ArrowDown' ? 1 : - 1);
+ var nextOption = this.getNextOption_(e.key == 'ArrowDown' ? 1 : -1);
if (nextOption)
nextOption.focus();
@@ -95,8 +93,8 @@ Polymer({
var counter = 0;
var nextOption = null;
var numOptions = this.options_.length;
- var focusedIndex = Array.prototype.indexOf.call(
- this.options_, this.root.activeElement);
+ var focusedIndex =
+ Array.prototype.indexOf.call(this.options_, this.root.activeElement);
do {
focusedIndex = (numOptions + focusedIndex + step) % numOptions;
@@ -144,10 +142,9 @@ Polymer({
// Attempt to show the menu starting from the top of the rectangle and
// extending downwards. If that does not fit within the window, fallback to
// starting from the bottom and extending upwards.
- var top = rect.top + this.offsetHeight <= window.innerHeight ?
- rect.top :
- rect.bottom - this.offsetHeight - Math.max(
- rect.bottom - window.innerHeight, 0);
+ var top = rect.top + this.offsetHeight <= window.innerHeight ? rect.top :
+ rect.bottom -
+ this.offsetHeight - Math.max(rect.bottom - window.innerHeight, 0);
this.style.top = top + 'px';
},

Powered by Google App Engine
This is Rietveld 408576698