You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
793 B
JavaScript
28 lines
793 B
JavaScript
const openChatButton = document.getElementById('openChatContainer');
|
|
const osichatWidget = document.getElementById('osichatWidget');
|
|
const closeChatButton = document.getElementById('closeChatContainer');
|
|
const conversation = document.getElementById('conversation');
|
|
|
|
function scrollToBottom() {
|
|
conversation.scrollTop = conversation.scrollHeight;
|
|
}
|
|
|
|
openChatButton.addEventListener('click', function () {
|
|
osichatWidget.classList.remove('hidden');
|
|
openChatButton.classList.add('hidden');
|
|
closeChatButton.classList.remove('hidden');
|
|
scrollToBottom();
|
|
});
|
|
|
|
function closeChat() {
|
|
osichatWidget.classList.add('hidden');
|
|
openChatButton.classList.remove('hidden');
|
|
closeChatButton.classList.add('hidden');
|
|
}
|
|
|
|
|
|
closeChatButton.addEventListener('click', closeChat);
|
|
|
|
|
|
|