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