Restore dots menu on mobile

This commit is contained in:
Jesús Espino 2020-08-05 09:49:39 +02:00 committed by Jaya Allamsetty
parent 858ee557d4
commit 1426a5b4bc
1 changed files with 7 additions and 4 deletions

View File

@ -30,6 +30,7 @@ import {
participantUpdated
} from '../../../base/participants';
import { connect, equals } from '../../../base/redux';
import { isMobileBrowser } from '../../../base/environment/utils';
import { OverflowMenuItem } from '../../../base/toolbox/components';
import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
import { VideoBlurButton } from '../../../blur';
@ -1233,6 +1234,8 @@ class Toolbox extends Component<Props, State> {
/ 2 // divide by the number of groups(left and right group)
);
const showOverflowMenu = this.state.windowWidth >= verySmallThreshold || isMobileBrowser();
if (this._shouldShowButton('chat')) {
buttonsLeft.push('chat');
}
@ -1246,7 +1249,7 @@ class Toolbox extends Component<Props, State> {
if (this._shouldShowButton('closedcaptions')) {
buttonsLeft.push('closedcaptions');
}
if (overflowHasItems && this.state.windowWidth >= verySmallThreshold) {
if (overflowHasItems && showOverflowMenu) {
buttonsRight.push('overflowmenu');
}
if (this._shouldShowButton('invite')) {
@ -1269,13 +1272,13 @@ class Toolbox extends Component<Props, State> {
movedButtons.push(...buttonsLeft.splice(
maxNumberOfButtonsPerGroup,
buttonsLeft.length - maxNumberOfButtonsPerGroup));
if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
if (buttonsRight.indexOf('overflowmenu') === -1 && showOverflowMenu) {
buttonsRight.unshift('overflowmenu');
}
}
if (buttonsRight.length > maxNumberOfButtonsPerGroup) {
if (buttonsRight.indexOf('overflowmenu') === -1 && this.state.windowWidth >= verySmallThreshold) {
if (buttonsRight.indexOf('overflowmenu') === -1 && showOverflowMenu) {
buttonsRight.unshift('overflowmenu');
}
@ -1346,7 +1349,7 @@ class Toolbox extends Component<Props, State> {
tooltip = { t('toolbar.invite') } /> }
{ buttonsRight.indexOf('security') !== -1
&& <SecurityDialogButton customClass = 'security-toolbar-button' /> }
{ buttonsRight.indexOf('overflowmenu') !== -1 && this.state.windowWidth >= verySmallThreshold
{ buttonsRight.indexOf('overflowmenu') !== -1
&& <OverflowMenuButton
isOpen = { _overflowMenuVisible }
onVisibilityChange = { this._onSetOverflowVisible }>