|
@@ -1,19 +1,12 @@
|
1
|
|
-/* @flow */
|
|
1
|
+// @flow
|
2
|
2
|
|
3
|
3
|
import React from 'react';
|
4
|
|
-import _ from 'lodash';
|
5
|
4
|
|
6
|
5
|
import { ParticipantCounter } from '../contact-list';
|
7
|
6
|
import { openDeviceSelectionDialog } from '../device-selection';
|
8
|
|
-
|
9
|
|
-import {
|
10
|
|
- InfoDialogButton,
|
11
|
|
- openInviteDialog
|
12
|
|
-} from '../invite';
|
13
|
|
-
|
14
|
|
-import { VideoQualityButton } from '../video-quality';
|
15
|
|
-
|
|
7
|
+import { InfoDialogButton, openInviteDialog } from '../invite';
|
16
|
8
|
import UIEvents from '../../../service/UI/UIEvents';
|
|
9
|
+import { VideoQualityButton } from '../video-quality';
|
17
|
10
|
|
18
|
11
|
import ProfileButton from './components/ProfileButton';
|
19
|
12
|
|
|
@@ -21,19 +14,22 @@ declare var APP: Object;
|
21
|
14
|
declare var interfaceConfig: Object;
|
22
|
15
|
declare var JitsiMeetJS: Object;
|
23
|
16
|
|
24
|
|
-let buttons: Object = {};
|
|
17
|
+/**
|
|
18
|
+ * The cache of {@link getDefaultButtons()}.
|
|
19
|
+ */
|
|
20
|
+let defaultButtons: Object;
|
25
|
21
|
|
26
|
22
|
/**
|
27
|
23
|
* Returns a map of all button descriptors and according properties.
|
28
|
24
|
*
|
29
|
|
- * @returns {*} - The maps of default button descriptors.
|
|
25
|
+ * @returns {Object} - The maps of default button descriptors.
|
30
|
26
|
*/
|
31
|
|
-function getDefaultButtons() {
|
32
|
|
- if (!_.isEmpty(buttons)) {
|
33
|
|
- return buttons;
|
|
27
|
+export default function getDefaultButtons() {
|
|
28
|
+ if (defaultButtons) {
|
|
29
|
+ return defaultButtons;
|
34
|
30
|
}
|
35
|
31
|
|
36
|
|
- buttons = {
|
|
32
|
+ defaultButtons = {
|
37
|
33
|
/**
|
38
|
34
|
* The descriptor of the camera toolbar button.
|
39
|
35
|
*/
|
|
@@ -400,15 +396,24 @@ function getDefaultButtons() {
|
400
|
396
|
}
|
401
|
397
|
};
|
402
|
398
|
|
403
|
|
- Object.keys(buttons).forEach(name => {
|
404
|
|
- const button = buttons[name];
|
|
399
|
+ Object.keys(defaultButtons).forEach(name => {
|
|
400
|
+ const button = defaultButtons[name];
|
405
|
401
|
|
406
|
402
|
if (!button.isDisplayed) {
|
407
|
|
- button.isDisplayed = () => !interfaceConfig.filmStripOnly;
|
|
403
|
+ button.isDisplayed = _isDisplayed;
|
408
|
404
|
}
|
409
|
405
|
});
|
410
|
406
|
|
411
|
|
- return buttons;
|
|
407
|
+ return defaultButtons;
|
412
|
408
|
}
|
413
|
409
|
|
414
|
|
-export default getDefaultButtons;
|
|
410
|
+/**
|
|
411
|
+ * The default implementation of the {@code isDisplayed} method of the toolbar
|
|
412
|
+ * button definition returned by {@link getDefaultButtons()}.
|
|
413
|
+ *
|
|
414
|
+ * @returns {boolean} If the user intarface is full i.e. not filmstrip-only,
|
|
415
|
+ * then {@code true}; otherwise, {@code false}.
|
|
416
|
+ */
|
|
417
|
+function _isDisplayed() {
|
|
418
|
+ return !interfaceConfig.filmStripOnly;
|
|
419
|
+}
|