|
|
@@ -36,7 +36,11 @@ import {
|
|
36
|
36
|
VideoQualityDialog
|
|
37
|
37
|
} from '../../video-quality';
|
|
38
|
38
|
|
|
39
|
|
-import { setFullScreen, setToolbarHovered } from '../actions';
|
|
|
39
|
+import {
|
|
|
40
|
+ setFullScreen,
|
|
|
41
|
+ setOverflowMenuVisible,
|
|
|
42
|
+ setToolbarHovered
|
|
|
43
|
+} from '../actions';
|
|
40
|
44
|
|
|
41
|
45
|
import OverflowMenuButton from './OverflowMenuButton';
|
|
42
|
46
|
import OverflowMenuItem from './OverflowMenuItem';
|
|
|
@@ -118,6 +122,11 @@ type Props = {
|
|
118
|
122
|
*/
|
|
119
|
123
|
_localParticipantID: String,
|
|
120
|
124
|
|
|
|
125
|
+ /**
|
|
|
126
|
+ * Whether or not the overflow menu is visible.
|
|
|
127
|
+ */
|
|
|
128
|
+ _overflowMenuVisible: boolean,
|
|
|
129
|
+
|
|
121
|
130
|
/**
|
|
122
|
131
|
* Whether or not the local participant's hand is raised.
|
|
123
|
132
|
*/
|
|
|
@@ -160,14 +169,6 @@ type Props = {
|
|
160
|
169
|
t: Function
|
|
161
|
170
|
}
|
|
162
|
171
|
|
|
163
|
|
-type State = {
|
|
164
|
|
-
|
|
165
|
|
- /**
|
|
166
|
|
- * Whether or not the overflow menu is visible.
|
|
167
|
|
- */
|
|
168
|
|
- showOverflowMenu: boolean
|
|
169
|
|
-}
|
|
170
|
|
-
|
|
171
|
172
|
declare var APP: Object;
|
|
172
|
173
|
declare var interfaceConfig: Object;
|
|
173
|
174
|
|
|
|
@@ -176,13 +177,9 @@ declare var interfaceConfig: Object;
|
|
176
|
177
|
*
|
|
177
|
178
|
* @extends Component
|
|
178
|
179
|
*/
|
|
179
|
|
-class Toolbox extends Component<Props, State> {
|
|
|
180
|
+class Toolbox extends Component<Props> {
|
|
180
|
181
|
_visibleButtons: Object;
|
|
181
|
182
|
|
|
182
|
|
- state = {
|
|
183
|
|
- showOverflowMenu: false
|
|
184
|
|
- }
|
|
185
|
|
-
|
|
186
|
183
|
/**
|
|
187
|
184
|
* Initializes a new {@code Toolbox} instance.
|
|
188
|
185
|
*
|
|
|
@@ -282,11 +279,11 @@ class Toolbox extends Component<Props, State> {
|
|
282
|
279
|
*/
|
|
283
|
280
|
componentWillReceiveProps(nextProps) {
|
|
284
|
281
|
// Ensure the dialog is closed when the toolbox becomes hidden.
|
|
285
|
|
- if (this.state.showOverflowMenu && !nextProps._visible) {
|
|
|
282
|
+ if (this.props._overflowMenuVisible && !nextProps._visible) {
|
|
286
|
283
|
this._onSetOverflowVisible(false);
|
|
287
|
284
|
}
|
|
288
|
285
|
|
|
289
|
|
- if (this.state.showOverflowMenu
|
|
|
286
|
+ if (this.props._overflowMenuVisible
|
|
290
|
287
|
&& !this.props._dialog
|
|
291
|
288
|
&& nextProps._dialog) {
|
|
292
|
289
|
this._onSetOverflowVisible(false);
|
|
|
@@ -315,6 +312,7 @@ class Toolbox extends Component<Props, State> {
|
|
315
|
312
|
const {
|
|
316
|
313
|
_chatOpen,
|
|
317
|
314
|
_hideInviteButton,
|
|
|
315
|
+ _overflowMenuVisible,
|
|
318
|
316
|
_raisedHand,
|
|
319
|
317
|
_visible,
|
|
320
|
318
|
t
|
|
|
@@ -373,7 +371,7 @@ class Toolbox extends Component<Props, State> {
|
|
373
|
371
|
{ this._shouldShowButton('info') && <InfoDialogButton /> }
|
|
374
|
372
|
{ overflowHasItems
|
|
375
|
373
|
&& <OverflowMenuButton
|
|
376
|
|
- isOpen = { this.state.showOverflowMenu }
|
|
|
374
|
+ isOpen = { _overflowMenuVisible }
|
|
377
|
375
|
onVisibilityChange = { this._onSetOverflowVisible }>
|
|
378
|
376
|
<ul
|
|
379
|
377
|
aria-label = 'Overflow menu'
|
|
|
@@ -555,7 +553,7 @@ class Toolbox extends Component<Props, State> {
|
|
555
|
553
|
* @returns {void}
|
|
556
|
554
|
*/
|
|
557
|
555
|
_onSetOverflowVisible(visible) {
|
|
558
|
|
- this.setState({ showOverflowMenu: visible });
|
|
|
556
|
+ this.props.dispatch(setOverflowMenuVisible(visible));
|
|
559
|
557
|
}
|
|
560
|
558
|
|
|
561
|
559
|
_onShortcutToggleChat: () => void;
|
|
|
@@ -764,21 +762,6 @@ class Toolbox extends Component<Props, State> {
|
|
764
|
762
|
this._doToggleFullScreen();
|
|
765
|
763
|
}
|
|
766
|
764
|
|
|
767
|
|
- _onToolbarToggleOverflowMenu: () => void;
|
|
768
|
|
-
|
|
769
|
|
- /**
|
|
770
|
|
- * Callback invoked to change whether the {@code OverflowMenu} is displayed
|
|
771
|
|
- * or not.
|
|
772
|
|
- *
|
|
773
|
|
- * @private
|
|
774
|
|
- * @returns {void}
|
|
775
|
|
- */
|
|
776
|
|
- _onToolbarToggleOverflowMenu() {
|
|
777
|
|
- sendAnalytics(createToolbarEvent('overflow'));
|
|
778
|
|
-
|
|
779
|
|
- this.setState({ showOverflowMenu: !this.state.showOverflowMenu });
|
|
780
|
|
- }
|
|
781
|
|
-
|
|
782
|
765
|
_onToolbarToggleProfile: () => void;
|
|
783
|
766
|
|
|
784
|
767
|
/**
|
|
|
@@ -1076,6 +1059,7 @@ function _mapStateToProps(state) {
|
|
1076
|
1059
|
const {
|
|
1077
|
1060
|
alwaysVisible,
|
|
1078
|
1061
|
fullScreen,
|
|
|
1062
|
+ overflowMenuVisible,
|
|
1079
|
1063
|
timeoutID,
|
|
1080
|
1064
|
visible
|
|
1081
|
1065
|
} = state['features/toolbox'];
|
|
|
@@ -1100,6 +1084,7 @@ function _mapStateToProps(state) {
|
|
1100
|
1084
|
_isRecording: isRecording,
|
|
1101
|
1085
|
_fullScreen: fullScreen,
|
|
1102
|
1086
|
_localParticipantID: localParticipant.id,
|
|
|
1087
|
+ _overflowMenuVisible: overflowMenuVisible,
|
|
1103
|
1088
|
_raisedHand: localParticipant.raisedHand,
|
|
1104
|
1089
|
_recordingEnabled: isModerator && enableRecording
|
|
1105
|
1090
|
&& (conference && conference.isRecordingSupported()),
|