Browse Source

Change the visual when it is switched between chat and contact list.

j8
fo 11 years ago
parent
commit
4d5bb61f0a
4 changed files with 99 additions and 163 deletions
  1. 8
    2
      bottom_toolbar.js
  2. 49
    82
      chat.js
  3. 41
    78
      contact_list.js
  4. 1
    1
      css/contact_list.css

+ 8
- 2
bottom_toolbar.js View File

2
     my.toggleChat = function() {
2
     my.toggleChat = function() {
3
         if (ContactList.isVisible()) {
3
         if (ContactList.isVisible()) {
4
             buttonClick("#contactListButton", "active");
4
             buttonClick("#contactListButton", "active");
5
-            ContactList.toggleContactList();
5
+            $('#contactlist').css('z-index', 4);
6
+            setTimeout(function() {
7
+                $('#contactlist').css('display', 'none');
8
+                $('#contactlist').css('z-index', 5);
9
+            }, 500);
6
         }
10
         }
7
 
11
 
8
         buttonClick("#chatBottomButton", "active");
12
         buttonClick("#chatBottomButton", "active");
13
     my.toggleContactList = function() {
17
     my.toggleContactList = function() {
14
         if (Chat.isVisible()) {
18
         if (Chat.isVisible()) {
15
             buttonClick("#chatBottomButton", "active");
19
             buttonClick("#chatBottomButton", "active");
16
-            Chat.toggleChat();
20
+            setTimeout(function() {
21
+                $('#chatspace').css('display', 'none');
22
+            }, 500);
17
         }
23
         }
18
 
24
 
19
         buttonClick("#contactListButton", "active");
25
         buttonClick("#contactListButton", "active");

+ 49
- 82
chat.js View File

143
         var chatspace = $('#chatspace');
143
         var chatspace = $('#chatspace');
144
         var videospace = $('#videospace');
144
         var videospace = $('#videospace');
145
 
145
 
146
-        var chatSize = (chatspace.is(":visible")) ? [0, 0] : Chat.getChatSize();
146
+        var chatSize = (Chat.isVisible()) ? [0, 0] : Chat.getChatSize();
147
         var videospaceWidth = window.innerWidth - chatSize[0];
147
         var videospaceWidth = window.innerWidth - chatSize[0];
148
         var videospaceHeight = window.innerHeight;
148
         var videospaceHeight = window.innerHeight;
149
         var videoSize
149
         var videoSize
160
         var thumbnailSize = VideoLayout.calculateThumbnailSize(videospaceWidth);
160
         var thumbnailSize = VideoLayout.calculateThumbnailSize(videospaceWidth);
161
         var thumbnailsWidth = thumbnailSize[0];
161
         var thumbnailsWidth = thumbnailSize[0];
162
         var thumbnailsHeight = thumbnailSize[1];
162
         var thumbnailsHeight = thumbnailSize[1];
163
-
164
-        if (chatspace.is(":visible")) {
165
-            videospace.animate({right: chatSize[0],
166
-                                width: videospaceWidth,
167
-                                height: videospaceHeight},
168
-                                {queue: false,
169
-                                duration: 500});
170
-
171
-            $('#remoteVideos').animate({height: thumbnailsHeight},
163
+        var completeFunction = Chat.isVisible() ?
164
+            function() {} : function () {
165
+                                scrollChatToBottom();
166
+                                chatspace.trigger('shown');
167
+                            };
168
+
169
+        videospace.animate({right: chatSize[0],
170
+                            width: videospaceWidth,
171
+                            height: videospaceHeight},
172
+                            {queue: false,
173
+                            duration: 500,
174
+                            complete: completeFunction});
175
+
176
+        $('#remoteVideos').animate({height: thumbnailsHeight},
177
+                                    {queue: false,
178
+                                    duration: 500});
179
+
180
+        $('#remoteVideos>span').animate({height: thumbnailsHeight,
181
+                                        width: thumbnailsWidth},
172
                                         {queue: false,
182
                                         {queue: false,
173
-                                        duration: 500});
174
-
175
-            $('#remoteVideos>span').animate({height: thumbnailsHeight,
176
-                                            width: thumbnailsWidth},
183
+                                        duration: 500,
184
+                                        complete: function() {
185
+                                            $(document).trigger(
186
+                                                    "remotevideo.resized",
187
+                                                    [thumbnailsWidth,
188
+                                                     thumbnailsHeight]);
189
+                                        }});
190
+
191
+        $('#largeVideoContainer').animate({ width: videospaceWidth,
192
+                                            height: videospaceHeight},
177
                                             {queue: false,
193
                                             {queue: false,
178
-                                            duration: 500,
179
-                                            complete: function() {
180
-                                                $(document).trigger(
181
-                                                        "remotevideo.resized",
182
-                                                        [thumbnailsWidth,
183
-                                                         thumbnailsHeight]);
184
-                                            }});
185
-
186
-            $('#largeVideoContainer').animate({ width: videospaceWidth,
187
-                                                height: videospaceHeight},
188
-                                                {queue: false,
189
-                                                 duration: 500
190
-                                                });
191
-
192
-            $('#largeVideo').animate({  width: videoWidth,
193
-                                        height: videoHeight,
194
-                                        top: verticalIndent,
195
-                                        bottom: verticalIndent,
196
-                                        left: horizontalIndent,
197
-                                        right: horizontalIndent},
198
-                                        {   queue: false,
199
-                                            duration: 500
200
-                                        });
201
-
202
-            $('#chatspace').hide("slide", { direction: "right",
194
+                                             duration: 500
195
+                                            });
196
+
197
+        $('#largeVideo').animate({  width: videoWidth,
198
+                                    height: videoHeight,
199
+                                    top: verticalIndent,
200
+                                    bottom: verticalIndent,
201
+                                    left: horizontalIndent,
202
+                                    right: horizontalIndent},
203
+                                    {   queue: false,
204
+                                        duration: 500
205
+                                    }
206
+        );
207
+
208
+        if (Chat.isVisible()) {
209
+            chatspace.hide("slide", { direction: "right",
203
                                             queue: false,
210
                                             queue: false,
204
                                             duration: 500});
211
                                             duration: 500});
205
         }
212
         }
206
         else {
213
         else {
207
             // Undock the toolbar when the chat is shown and if we're in a 
214
             // Undock the toolbar when the chat is shown and if we're in a 
208
             // video mode.
215
             // video mode.
209
-            if (VideoLayout.isLargeVideoVisible())
216
+            if (VideoLayout.isLargeVideoVisible()) {
210
                 ToolbarToggler.dockToolbar(false);
217
                 ToolbarToggler.dockToolbar(false);
218
+            }
211
 
219
 
212
-            videospace.animate({right: chatSize[0],
213
-                                width: videospaceWidth,
214
-                                height: videospaceHeight},
215
-                               {queue: false,
216
-                                duration: 500,
217
-                                complete: function () {
218
-                                    scrollChatToBottom();
219
-                                    chatspace.trigger('shown');
220
-                                }
221
-                               });
222
-
223
-            $('#remoteVideos').animate({height: thumbnailsHeight},
224
-                    {queue: false,
225
-                    duration: 500});
226
-
227
-            $('#remoteVideos>span').animate({height: thumbnailsHeight,
228
-                        width: thumbnailsWidth},
229
-                        {queue: false,
230
-                        duration: 500,
231
-                        complete: function() {
232
-                            $(document).trigger(
233
-                                    "remotevideo.resized",
234
-                                    [thumbnailsWidth, thumbnailsHeight]);
235
-                        }});
236
-
237
-            $('#largeVideoContainer').animate({ width: videospaceWidth,
238
-                                                height: videospaceHeight},
239
-                                                {queue: false,
240
-                                                 duration: 500
241
-                                                });
242
-
243
-            $('#largeVideo').animate({  width: videoWidth,
244
-                                        height: videoHeight,
245
-                                        top: verticalIndent,
246
-                                        bottom: verticalIndent,
247
-                                        left: horizontalIndent,
248
-                                        right: horizontalIndent},
249
-                                        {queue: false,
250
-                                         duration: 500
251
-                                        });
252
-
253
-            $('#chatspace').show("slide", { direction: "right",
220
+            chatspace.show("slide", { direction: "right",
254
                                             queue: false,
221
                                             queue: false,
255
                                             duration: 500,
222
                                             duration: 500,
256
                                             complete: function () {
223
                                             complete: function () {

+ 41
- 78
contact_list.js View File

96
         var thumbnailSize = VideoLayout.calculateThumbnailSize(videospaceWidth);
96
         var thumbnailSize = VideoLayout.calculateThumbnailSize(videospaceWidth);
97
         var thumbnailsWidth = thumbnailSize[0];
97
         var thumbnailsWidth = thumbnailSize[0];
98
         var thumbnailsHeight = thumbnailSize[1];
98
         var thumbnailsHeight = thumbnailSize[1];
99
-
100
-        if (ContactList.isVisible()) {
101
-            videospace.animate({right: chatSize[0],
102
-                                width: videospaceWidth,
103
-                                height: videospaceHeight},
104
-                                {queue: false,
105
-                                duration: 500});
106
-
107
-            $('#remoteVideos').animate({height: thumbnailsHeight},
99
+        var completeFunction = ContactList.isVisible() ?
100
+            function() {} : function () { contactlist.trigger('shown');};
101
+
102
+        videospace.animate({right: chatSize[0],
103
+                            width: videospaceWidth,
104
+                            height: videospaceHeight},
105
+                            {queue: false,
106
+                            duration: 500,
107
+                            complete: completeFunction
108
+                            });
109
+
110
+        $('#remoteVideos').animate({height: thumbnailsHeight},
111
+                                    {queue: false,
112
+                                    duration: 500});
113
+
114
+        $('#remoteVideos>span').animate({height: thumbnailsHeight,
115
+                                        width: thumbnailsWidth},
108
                                         {queue: false,
116
                                         {queue: false,
109
-                                        duration: 500});
110
-
111
-            $('#remoteVideos>span').animate({height: thumbnailsHeight,
112
-                                            width: thumbnailsWidth},
117
+                                        duration: 500,
118
+                                        complete: function() {
119
+                                            $(document).trigger(
120
+                                                    "remotevideo.resized",
121
+                                                    [thumbnailsWidth,
122
+                                                     thumbnailsHeight]);
123
+                                        }});
124
+
125
+        $('#largeVideoContainer').animate({ width: videospaceWidth,
126
+                                            height: videospaceHeight},
113
                                             {queue: false,
127
                                             {queue: false,
114
-                                            duration: 500,
115
-                                            complete: function() {
116
-                                                $(document).trigger(
117
-                                                        "remotevideo.resized",
118
-                                                        [thumbnailsWidth,
119
-                                                         thumbnailsHeight]);
120
-                                            }});
121
-
122
-            $('#largeVideoContainer').animate({ width: videospaceWidth,
123
-                                                height: videospaceHeight},
124
-                                                {queue: false,
125
-                                                 duration: 500
126
-                                                });
127
-
128
-            $('#largeVideo').animate({  width: videoWidth,
129
-                                        height: videoHeight,
130
-                                        top: verticalIndent,
131
-                                        bottom: verticalIndent,
132
-                                        left: horizontalIndent,
133
-                                        right: horizontalIndent},
134
-                                        {   queue: false,
135
-                                            duration: 500
136
-                                        });
128
+                                             duration: 500
129
+                                            });
130
+
131
+        $('#largeVideo').animate({  width: videoWidth,
132
+                                    height: videoHeight,
133
+                                    top: verticalIndent,
134
+                                    bottom: verticalIndent,
135
+                                    left: horizontalIndent,
136
+                                    right: horizontalIndent},
137
+                                    {   queue: false,
138
+                                        duration: 500
139
+                                    });
137
 
140
 
141
+        if (ContactList.isVisible()) {
138
             $('#contactlist').hide("slide", { direction: "right",
142
             $('#contactlist').hide("slide", { direction: "right",
139
                                             queue: false,
143
                                             queue: false,
140
                                             duration: 500});
144
                                             duration: 500});
141
-        }
142
-        else {
145
+        } else {
143
             // Undock the toolbar when the chat is shown and if we're in a 
146
             // Undock the toolbar when the chat is shown and if we're in a 
144
             // video mode.
147
             // video mode.
145
             if (VideoLayout.isLargeVideoVisible())
148
             if (VideoLayout.isLargeVideoVisible())
146
                 ToolbarToggler.dockToolbar(false);
149
                 ToolbarToggler.dockToolbar(false);
147
 
150
 
148
-            videospace.animate({right: chatSize[0],
149
-                                width: videospaceWidth,
150
-                                height: videospaceHeight},
151
-                               {queue: false,
152
-                                duration: 500,
153
-                                complete: function () {
154
-                                    contactlist.trigger('shown');
155
-                                }
156
-                               });
157
-
158
-            $('#remoteVideos').animate({height: thumbnailsHeight},
159
-                    {queue: false,
160
-                    duration: 500});
161
-
162
-            $('#remoteVideos>span').animate({height: thumbnailsHeight,
163
-                        width: thumbnailsWidth},
164
-                        {queue: false,
165
-                        duration: 500,
166
-                        complete: function() {
167
-                            $(document).trigger(
168
-                                    "remotevideo.resized",
169
-                                    [thumbnailsWidth, thumbnailsHeight]);
170
-                        }});
171
-
172
-            $('#largeVideoContainer').animate({ width: videospaceWidth,
173
-                                                height: videospaceHeight},
174
-                                                {queue: false,
175
-                                                 duration: 500
176
-                                                });
177
-
178
-            $('#largeVideo').animate({  width: videoWidth,
179
-                                        height: videoHeight,
180
-                                        top: verticalIndent,
181
-                                        bottom: verticalIndent,
182
-                                        left: horizontalIndent,
183
-                                        right: horizontalIndent},
184
-                                        {queue: false,
185
-                                         duration: 500
186
-                                        });
187
-
188
             $('#contactlist').show("slide", { direction: "right",
151
             $('#contactlist').show("slide", { direction: "right",
189
                                             queue: false,
152
                                             queue: false,
190
                                             duration: 500});
153
                                             duration: 500});

+ 1
- 1
css/contact_list.css View File

1
 #contactlist {
1
 #contactlist {
2
-    background-color:rgba(0,0,0,.65);
2
+    background-color: black;
3
 }
3
 }
4
 
4
 
5
 #contactlist>ul {
5
 #contactlist>ul {

Loading…
Cancel
Save