Просмотр исходного кода

Fixes resizing problems introduced with previous resizing commit. Fixes side panel open/close code and resizing.

master
yanas 9 лет назад
Родитель
Сommit
ad44cc518a

+ 23
- 16
modules/UI/side_pannels/SidePanelToggler.js Просмотреть файл

22
  * @param onOpenComplete function to be called when the panel is opened
22
  * @param onOpenComplete function to be called when the panel is opened
23
  * @param onOpen function to be called if the window is going to be opened
23
  * @param onOpen function to be called if the window is going to be opened
24
  * @param onClose function to be called if the window is going to be closed
24
  * @param onClose function to be called if the window is going to be closed
25
+ * @param onVideoResizeComplete function to be called after the video area
26
+ * is resized
25
  */
27
  */
26
-function toggle (object, selector, onOpenComplete, onOpen, onClose) {
28
+function toggle (object, selector, onOpenComplete,
29
+                 onOpen, onClose, onVideoResizeComplete) {
30
+    let isSideBarVisible = object.isVisible();
31
+
27
     UIUtil.buttonClick(buttons[selector], "active");
32
     UIUtil.buttonClick(buttons[selector], "active");
28
 
33
 
29
-    if (object.isVisible()) {
34
+    if (isSideBarVisible) {
30
         $("#toast-container").animate({
35
         $("#toast-container").animate({
31
             right: 5
36
             right: 5
32
         }, {
37
         }, {
38
             queue: false,
43
             queue: false,
39
             duration: 500
44
             duration: 500
40
         });
45
         });
46
+
47
+        resizeVideoArea(isSideBarVisible, onVideoResizeComplete);
48
+
41
         if(typeof onClose === "function") {
49
         if(typeof onClose === "function") {
42
             onClose();
50
             onClose();
43
         }
51
         }
44
 
52
 
45
         currentlyOpen = null;
53
         currentlyOpen = null;
46
     } else {
54
     } else {
55
+        resizeVideoArea(isSideBarVisible, onVideoResizeComplete);
56
+
47
         // Undock the toolbar when the chat is shown and if we're in a
57
         // Undock the toolbar when the chat is shown and if we're in a
48
         // video mode.
58
         // video mode.
49
         if (VideoLayout.isLargeVideoVisible()) {
59
         if (VideoLayout.isLargeVideoVisible()) {
80
     }
90
     }
81
 }
91
 }
82
 
92
 
93
+function resizeVideoArea(isSidePanelVisible, completeFunction) {
94
+    VideoLayout.resizeVideoArea(!isSidePanelVisible,
95
+        false,
96
+        true,
97
+        completeFunction);
98
+}
99
+
83
 /**
100
 /**
84
  * Toggler for the chat, contact list, settings menu, etc..
101
  * Toggler for the chat, contact list, settings menu, etc..
85
  */
102
  */
96
                 $('#chatspace').trigger('shown');
113
                 $('#chatspace').trigger('shown');
97
             };
114
             };
98
 
115
 
99
-        VideoLayout.resizeVideoArea(!Chat.isVisible(),
100
-                                    false,
101
-                                    true,
102
-                                    chatCompleteFunction);
103
-
104
         toggle(Chat, //Object
116
         toggle(Chat, //Object
105
             '#chatspace', // Selector
117
             '#chatspace', // Selector
106
             function () { //onOpenComplete
118
             function () { //onOpenComplete
113
                 }
125
                 }
114
             },
126
             },
115
             () => this.resizeChat(), //OnOpen
127
             () => this.resizeChat(), //OnOpen
116
-            null); //OnClose
128
+            null,
129
+            chatCompleteFunction); //OnClose
117
     },
130
     },
118
 
131
 
119
     resizeChat () {
132
     resizeChat () {
130
             : function () {
143
             : function () {
131
                 $('#contactlist').trigger('shown');
144
                 $('#contactlist').trigger('shown');
132
             };
145
             };
133
-        VideoLayout.resizeVideoArea(
134
-            !ContactList.isVisible(),
135
-            false,
136
-            true,
137
-            completeFunction);
138
 
146
 
139
         toggle(ContactList,
147
         toggle(ContactList,
140
             '#contactlist',
148
             '#contactlist',
142
             function() {
150
             function() {
143
                 ContactList.setVisualNotification(false);
151
                 ContactList.setVisualNotification(false);
144
             },
152
             },
145
-            null);
153
+            null,
154
+            completeFunction);
146
     },
155
     },
147
 
156
 
148
     /**
157
     /**
149
      * Opens / closes the settings menu
158
      * Opens / closes the settings menu
150
      */
159
      */
151
     toggleSettingsMenu () {
160
     toggleSettingsMenu () {
152
-        VideoLayout.resizeVideoArea(
153
-            !SettingsMenu.isVisible(), false, true, function (){});
154
         toggle(SettingsMenu,
161
         toggle(SettingsMenu,
155
             '#settingsmenu',
162
             '#settingsmenu',
156
             null,
163
             null,

+ 6
- 8
modules/UI/videolayout/FilmStrip.js Просмотреть файл

43
      * @param videoAreaAvailableWidth the currently available video area width
43
      * @param videoAreaAvailableWidth the currently available video area width
44
      * that we want to take into account when calculating the film strip width.
44
      * that we want to take into account when calculating the film strip width.
45
      */
45
      */
46
-     calculateThumbnailSize (videoAreaAvailableWidth) {
46
+     calculateThumbnailSize (isSideBarVisible) {
47
         // Calculate the available height, which is the inner window height
47
         // Calculate the available height, which is the inner window height
48
         // minus 39px for the header minus 2px for the delimiter lines on the
48
         // minus 39px for the header minus 2px for the delimiter lines on the
49
         // top and bottom of the large video, minus the 36px space inside the
49
         // top and bottom of the large video, minus the 36px space inside the
59
          * the filmStrip width, because we're probably in a state where the
59
          * the filmStrip width, because we're probably in a state where the
60
          * film strip size hasn't been updated yet, but it will be.
60
          * film strip size hasn't been updated yet, but it will be.
61
          */
61
          */
62
-        let filmStripWidth = videoAreaAvailableWidth
63
-            ? videoAreaAvailableWidth
62
+        let videoAreaAvailableWidth
63
+            = UIUtil.getAvailableVideoWidth(isSideBarVisible)
64
                 - parseInt(this.filmStrip.css('right'), 10)
64
                 - parseInt(this.filmStrip.css('right'), 10)
65
                 - parseInt(this.filmStrip.css('paddingLeft'), 10)
65
                 - parseInt(this.filmStrip.css('paddingLeft'), 10)
66
                 - parseInt(this.filmStrip.css('paddingRight'), 10)
66
                 - parseInt(this.filmStrip.css('paddingRight'), 10)
67
                 - parseInt(this.filmStrip.css('borderLeftWidth'), 10)
67
                 - parseInt(this.filmStrip.css('borderLeftWidth'), 10)
68
-                - parseInt(this.filmStrip.css('borderRightWidth'), 10)
69
-            : this.getFilmStripWidth();
70
-
68
+                - parseInt(this.filmStrip.css('borderRightWidth'), 10);
71
 
69
 
72
         let availableWidth = Math.floor(
70
         let availableWidth = Math.floor(
73
-                (filmStripWidth - numvids * (
71
+                (videoAreaAvailableWidth - numvids * (
74
                 parseInt(localVideoContainer.css('borderLeftWidth'), 10)
72
                 parseInt(localVideoContainer.css('borderLeftWidth'), 10)
75
                 + parseInt(localVideoContainer.css('borderRightWidth'), 10)
73
                 + parseInt(localVideoContainer.css('borderRightWidth'), 10)
76
                 + parseInt(localVideoContainer.css('paddingLeft'), 10)
74
                 + parseInt(localVideoContainer.css('paddingLeft'), 10)
77
                 + parseInt(localVideoContainer.css('paddingRight'), 10)
75
                 + parseInt(localVideoContainer.css('paddingRight'), 10)
78
                 + parseInt(localVideoContainer.css('marginLeft'), 10)
76
                 + parseInt(localVideoContainer.css('marginLeft'), 10)
79
                 + parseInt(localVideoContainer.css('marginRight'), 10)))
77
                 + parseInt(localVideoContainer.css('marginRight'), 10)))
80
-                / numvids) - numvids*10;
78
+                / numvids) - 20;
81
 
79
 
82
         let maxHeight
80
         let maxHeight
83
             // If the MAX_HEIGHT property hasn't been specified
81
             // If the MAX_HEIGHT property hasn't been specified

+ 0
- 1
modules/UI/videolayout/RemoteVideo.js Просмотреть файл

42
  * @param id the id indicating the video for which we're adding a menu.
42
  * @param id the id indicating the video for which we're adding a menu.
43
  * @param parentElement the parent element where this menu will be added
43
  * @param parentElement the parent element where this menu will be added
44
  */
44
  */
45
-
46
 if (!interfaceConfig.filmStripOnly) {
45
 if (!interfaceConfig.filmStripOnly) {
47
     RemoteVideo.prototype.addRemoteVideoMenu = function () {
46
     RemoteVideo.prototype.addRemoteVideoMenu = function () {
48
         var spanElement = document.createElement('span');
47
         var spanElement = document.createElement('span');

+ 13
- 5
modules/UI/videolayout/VideoLayout.js Просмотреть файл

12
 import LargeVideoManager, {VideoContainerType} from "./LargeVideo";
12
 import LargeVideoManager, {VideoContainerType} from "./LargeVideo";
13
 import {PreziContainerType} from '../prezi/Prezi';
13
 import {PreziContainerType} from '../prezi/Prezi';
14
 import LocalVideo from "./LocalVideo";
14
 import LocalVideo from "./LocalVideo";
15
+import PanelToggler from "../side_pannels/SidePanelToggler";
15
 
16
 
16
 const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper;
17
 const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper;
17
 
18
 
356
 
357
 
357
         console.info(resourceJid + " video is now active", videoelem);
358
         console.info(resourceJid + " video is now active", videoelem);
358
 
359
 
359
-        $(videoelem).show();
360
-        VideoLayout.resizeThumbnails();
360
+        VideoLayout.resizeThumbnails(
361
+            false, false, false, function() {$(videoelem).show();});
361
 
362
 
362
         // Update the large video to the last added video only if there's no
363
         // Update the large video to the last added video only if there's no
363
         // current dominant, focused speaker or prezi playing or update it to
364
         // current dominant, focused speaker or prezi playing or update it to
416
      */
417
      */
417
     resizeThumbnails (  animate = false,
418
     resizeThumbnails (  animate = false,
418
                         forceUpdate = false,
419
                         forceUpdate = false,
419
-                        videoAreaAvailableWidth = null) {
420
+                        isSideBarVisible = null,
421
+                        onComplete = null) {
422
+        isSideBarVisible
423
+            = (isSideBarVisible !== null)
424
+                ? isSideBarVisible : PanelToggler.isVisible();
425
+
420
         let {thumbWidth, thumbHeight}
426
         let {thumbWidth, thumbHeight}
421
-            = FilmStrip.calculateThumbnailSize(videoAreaAvailableWidth);
427
+            = FilmStrip.calculateThumbnailSize(isSideBarVisible);
422
 
428
 
423
         $('.userAvatar').css('left', (thumbWidth - thumbHeight) / 2);
429
         $('.userAvatar').css('left', (thumbWidth - thumbHeight) / 2);
424
 
430
 
427
             .then(function () {
433
             .then(function () {
428
                 BottomToolbar.resizeToolbar(thumbWidth, thumbHeight);
434
                 BottomToolbar.resizeToolbar(thumbWidth, thumbHeight);
429
                 AudioLevels.updateCanvasSize(thumbWidth, thumbHeight);
435
                 AudioLevels.updateCanvasSize(thumbWidth, thumbHeight);
436
+                if (onComplete && typeof onComplete === "function")
437
+                    onComplete();
430
         });
438
         });
431
         return {thumbWidth, thumbHeight};
439
         return {thumbWidth, thumbHeight};
432
     },
440
     },
815
         }
823
         }
816
 
824
 
817
         // Resize the thumbnails first.
825
         // Resize the thumbnails first.
818
-        this.resizeThumbnails(false, forceUpdate, availableWidth);
826
+        this.resizeThumbnails(false, forceUpdate, isSideBarVisible);
819
 
827
 
820
         // Resize the video area element.
828
         // Resize the video area element.
821
         $('#videospace').animate({
829
         $('#videospace').animate({

Загрузка…
Отмена
Сохранить