Commit d6932323 authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

[Switch Access] Reorder functions in MenuManager

Groups static/instance methods and alphabetizes within the groups.

This change reorders functions and makes some functions private, but
has no behavioral change.

Bug: 982004
Change-Id: If2730e9728eaf7459e1e53937adadf3b02d5e0fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078214
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745773}
parent 031cd78a
...@@ -8,12 +8,6 @@ ...@@ -8,12 +8,6 @@
*/ */
class Panel { class Panel {
constructor() { constructor() {
/**
* The menu manager.
* @private {MenuManager}
*/
this.menuManager_;
/** /**
* Reference to the menu panel element. * Reference to the menu panel element.
* @private {Element} * @private {Element}
...@@ -64,7 +58,7 @@ class Panel { ...@@ -64,7 +58,7 @@ class Panel {
/** Sets the menu manager to the given object. */ /** Sets the menu manager to the given object. */
set menuManager(menuManager) { set menuManager(menuManager) {
this.menuManager_ = menuManager; MenuManager.instance = menuManager;
} }
/** /**
...@@ -76,7 +70,7 @@ class Panel { ...@@ -76,7 +70,7 @@ class Panel {
setupButton_(button) { setupButton_(button) {
const action = button.id; const action = button.id;
button.addEventListener('click', function(action) { button.addEventListener('click', function(action) {
this.menuManager_.performAction(action); MenuManager.instance.performAction(action);
}.bind(this, action)); }.bind(this, action));
} }
...@@ -161,7 +155,7 @@ class Panel { ...@@ -161,7 +155,7 @@ class Panel {
* @private * @private
*/ */
updatePositionAttributes_(buttonOrder, menuId) { updatePositionAttributes_(buttonOrder, menuId) {
this.menuManager_.exit(); MenuManager.exit();
for (let pos = 0; pos < buttonOrder.length; pos++) { for (let pos = 0; pos < buttonOrder.length; pos++) {
const buttonPosition = pos; const buttonPosition = pos;
const button = document.getElementById(buttonOrder[pos]); const button = document.getElementById(buttonOrder[pos]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment