Sfoglia il codice sorgente

Merge pull request #1106 from jitsi/disabled-sidepanels-load

Disables loading side panels when they are disabled.
master
yanas 8 anni fa
parent
commit
f02f050e56
3 ha cambiato i file con 21 aggiunte e 10 eliminazioni
  1. 2
    1
      conference.js
  2. 10
    5
      modules/UI/UI.js
  3. 9
    4
      modules/UI/side_pannels/SidePanels.js

+ 2
- 1
conference.js Vedi File

@@ -514,7 +514,8 @@ export default {
514 514
                 this.isDesktopSharingEnabled =
515 515
                     JitsiMeetJS.isDesktopSharingEnabled();
516 516
 
517
-                APP.UI.ContactList = new ContactList(room);
517
+                if (UIUtil.isButtonEnabled('contacts'))
518
+                    APP.UI.ContactList = new ContactList(room);
518 519
 
519 520
                 // if user didn't give access to mic or camera or doesn't have
520 521
                 // them at all, we disable corresponding toolbar buttons

+ 10
- 5
modules/UI/UI.js Vedi File

@@ -203,7 +203,8 @@ UI.showChatError = function (err, msg) {
203 203
  * @param {string} displayName new nickname
204 204
  */
205 205
 UI.changeDisplayName = function (id, displayName) {
206
-    UI.ContactList.onDisplayNameChange(id, displayName);
206
+    if (UI.ContactList)
207
+        UI.ContactList.onDisplayNameChange(id, displayName);
207 208
     VideoLayout.onDisplayNameChanged(id, displayName);
208 209
 
209 210
     if (APP.conference.isLocalId(id) || id === 'localVideoContainer') {
@@ -249,7 +250,8 @@ UI.setLocalRaisedHandStatus = (raisedHandStatus) => {
249 250
 UI.initConference = function () {
250 251
     let id = APP.conference.getMyUserId();
251 252
     // Add myself to the contact list.
252
-    UI.ContactList.addContact(id, true);
253
+    if (UI.ContactList)
254
+        UI.ContactList.addContact(id, true);
253 255
 
254 256
     // Update default button states before showing the toolbar
255 257
     // if local role changes buttons state will be again updated.
@@ -559,7 +561,8 @@ UI.addUser = function (user) {
559 561
     var id = user.getId();
560 562
     var displayName = user.getDisplayName();
561 563
     UI.hideRingOverLay();
562
-    UI.ContactList.addContact(id);
564
+    if (UI.ContactList)
565
+        UI.ContactList.addContact(id);
563 566
 
564 567
     messageHandler.notify(
565 568
         displayName,'notify.somebody', 'connected', 'notify.connected'
@@ -586,7 +589,8 @@ UI.addUser = function (user) {
586 589
  * @param {string} displayName user nickname
587 590
  */
588 591
 UI.removeUser = function (id, displayName) {
589
-    UI.ContactList.removeContact(id);
592
+    if (UI.ContactList)
593
+        UI.ContactList.removeContact(id);
590 594
 
591 595
     messageHandler.notify(
592 596
         displayName,'notify.somebody', 'disconnected', 'notify.disconnected'
@@ -838,7 +842,8 @@ UI.dockToolbar = function (isDock) {
838 842
  */
839 843
 function changeAvatar(id, avatarUrl) {
840 844
     VideoLayout.changeUserAvatar(id, avatarUrl);
841
-    UI.ContactList.changeUserAvatar(id, avatarUrl);
845
+    if (UI.ContactList)
846
+        UI.ContactList.changeUserAvatar(id, avatarUrl);
842 847
     if (APP.conference.isLocalId(id)) {
843 848
         Profile.changeAvatar(avatarUrl);
844 849
     }

+ 9
- 4
modules/UI/side_pannels/SidePanels.js Vedi File

@@ -2,17 +2,22 @@ import Chat from './chat/Chat';
2 2
 import SettingsMenu from './settings/SettingsMenu';
3 3
 import Profile from './profile/Profile';
4 4
 import ContactListView from './contactlist/ContactListView';
5
+import UIUtil from '../util/UIUtil';
5 6
 
6 7
 const SidePanels = {
7 8
     init (eventEmitter) {
8 9
         //Initialize chat
9
-        Chat.init(eventEmitter);
10
+        if (UIUtil.isButtonEnabled('chat'))
11
+            Chat.init(eventEmitter);
10 12
         //Initialize settings
11
-        SettingsMenu.init(eventEmitter);
13
+        if (UIUtil.isButtonEnabled('settings'))
14
+            SettingsMenu.init(eventEmitter);
12 15
         //Initialize profile
13
-        Profile.init(eventEmitter);
16
+        if (UIUtil.isButtonEnabled('profile'))
17
+            Profile.init(eventEmitter);
14 18
         //Initialize contact list view
15
-        ContactListView.init();
19
+        if (UIUtil.isButtonEnabled('contacts'))
20
+            ContactListView.init();
16 21
     }
17 22
 };
18 23
 

Loading…
Annulla
Salva