From 26b40e9fb0bf3dbb0a8fdafd46113a86a39bbb63 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Mon, 5 Jun 2017 12:08:34 -0700 Subject: [PATCH] change counter variable name --- .../ui/components/dropdown/list/component.jsx | 18 +++++++++--------- .../ui/components/user-list/component.jsx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx b/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx index 321c8aa357..9fb9093523 100755 --- a/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/dropdown/list/component.jsx @@ -25,7 +25,7 @@ export default class DropdownList extends Component { this.childrenRefs = []; this.handleItemKeyDown = this.handleItemKeyDown.bind(this); this.handleItemClick = this.handleItemClick.bind(this); - this.counter = 0; + this.focusedItemIndex = 0; } componentWillMount() { @@ -51,7 +51,7 @@ export default class DropdownList extends Component { handleItemKeyDown(event, callback) { const { dropdownHide } = this.props; const { activeItemIndex } = this.state; - + let selectableItems = []; for (let i = 0; i < (this._menu.children.length); i++) { if (this._menu.children[i].getAttribute("role") === 'menuitem'){ @@ -63,7 +63,7 @@ export default class DropdownList extends Component { event.preventDefault(); event.stopPropagation(); - selectableItems[this.counter].focus(); + selectableItems[this.focusedItemIndex].focus(); } if ([KEY_CODES.ENTER, KEY_CODES.SPACE].includes(event.keyCode)) { @@ -74,20 +74,20 @@ export default class DropdownList extends Component { } if (KEY_CODES.ARROW_DOWN === event.which) { - this.counter += 1; + this.focusedItemIndex += 1; - if (!selectableItems[this.counter]) { - this.counter = 0; + if (!selectableItems[this.focusedItemIndex]) { + this.focusedItemIndex = 0; } focusMenuItem(); } if (KEY_CODES.ARROW_UP === event.which) { - this.counter -= 1; + this.focusedItemIndex -= 1; - if (this.counter < 0) { - this.counter = selectableItems.length - 1; + if (this.focusedItemIndex < 0) { + this.focusedItemIndex = selectableItems.length - 1; } focusMenuItem(); diff --git a/bigbluebutton-html5/imports/ui/components/user-list/component.jsx b/bigbluebutton-html5/imports/ui/components/user-list/component.jsx index 3d9fb8482c..a60b6a794d 100755 --- a/bigbluebutton-html5/imports/ui/components/user-list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/user-list/component.jsx @@ -93,7 +93,7 @@ class UserList extends Component { if (event.keyCode === KEY_CODES.ARROW_UP) { this.focusedItemIndex -= 1; - if (this.focusedItemIndex <= -1) { + if (this.focusedItemIndex < 0) { this.focusedItemIndex = numberOfItems - 1; }