Browse Source

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

Disables loading side panels when they are disabled.
master
yanas 8 years ago
parent
commit
f02f050e56
3 changed files with 21 additions and 10 deletions
  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 View File

514
                 this.isDesktopSharingEnabled =
514
                 this.isDesktopSharingEnabled =
515
                     JitsiMeetJS.isDesktopSharingEnabled();
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
                 // if user didn't give access to mic or camera or doesn't have
520
                 // if user didn't give access to mic or camera or doesn't have
520
                 // them at all, we disable corresponding toolbar buttons
521
                 // them at all, we disable corresponding toolbar buttons

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

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

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

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

Loading…
Cancel
Save