Fix TypeError: undefined is not an object
This commit is contained in:
parent
72c267fbf3
commit
e1056126e6
|
@ -164,9 +164,7 @@ function resizeChatConversation() {
|
||||||
* @param id {string} input id
|
* @param id {string} input id
|
||||||
*/
|
*/
|
||||||
function deferredFocus(id){
|
function deferredFocus(id){
|
||||||
setTimeout(function (){
|
setTimeout(() => $(`#${id}`).focus(), 400);
|
||||||
$(`#${id}`).focus();
|
|
||||||
}, 400);
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Chat related user interface.
|
* Chat related user interface.
|
||||||
|
@ -353,10 +351,17 @@ var Chat = {
|
||||||
* Scrolls chat to the bottom.
|
* Scrolls chat to the bottom.
|
||||||
*/
|
*/
|
||||||
scrollChatToBottom () {
|
scrollChatToBottom () {
|
||||||
setTimeout(function () {
|
setTimeout(
|
||||||
$('#chatconversation').scrollTop(
|
() => {
|
||||||
$('#chatconversation')[0].scrollHeight);
|
const chatconversation = $('#chatconversation');
|
||||||
}, 5);
|
|
||||||
|
// XXX Prevent TypeError: undefined is not an object when the
|
||||||
|
// Web browser does not support WebRTC (yet).
|
||||||
|
chatconversation.length > 0
|
||||||
|
&& chatconversation.scrollTop(
|
||||||
|
chatconversation[0].scrollHeight);
|
||||||
|
},
|
||||||
|
5);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue