|
@@ -164,9 +164,7 @@ function resizeChatConversation() {
|
164
|
164
|
* @param id {string} input id
|
165
|
165
|
*/
|
166
|
166
|
function deferredFocus(id){
|
167
|
|
- setTimeout(function (){
|
168
|
|
- $(`#${id}`).focus();
|
169
|
|
- }, 400);
|
|
167
|
+ setTimeout(() => $(`#${id}`).focus(), 400);
|
170
|
168
|
}
|
171
|
169
|
/**
|
172
|
170
|
* Chat related user interface.
|
|
@@ -353,10 +351,17 @@ var Chat = {
|
353
|
351
|
* Scrolls chat to the bottom.
|
354
|
352
|
*/
|
355
|
353
|
scrollChatToBottom () {
|
356
|
|
- setTimeout(function () {
|
357
|
|
- $('#chatconversation').scrollTop(
|
358
|
|
- $('#chatconversation')[0].scrollHeight);
|
359
|
|
- }, 5);
|
|
354
|
+ setTimeout(
|
|
355
|
+ () => {
|
|
356
|
+ const chatconversation = $('#chatconversation');
|
|
357
|
+
|
|
358
|
+ // XXX Prevent TypeError: undefined is not an object when the
|
|
359
|
+ // Web browser does not support WebRTC (yet).
|
|
360
|
+ chatconversation.length > 0
|
|
361
|
+ && chatconversation.scrollTop(
|
|
362
|
+ chatconversation[0].scrollHeight);
|
|
363
|
+ },
|
|
364
|
+ 5);
|
360
|
365
|
}
|
361
|
366
|
};
|
362
|
367
|
|