-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchat.js
31 lines (31 loc) · 966 Bytes
/
chat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$(function() {
'use strict'
$('#chatActiveContacts').lightSlider({
autoWidth: true,
controls: false,
pager: false,
slideMargin: 12
});
if (window.matchMedia('(min-width: 992px)').matches) {
new PerfectScrollbar('#ChatList', {
suppressScrollX: true
});
const ChatBody = new PerfectScrollbar('#ChatBody', {
suppressScrollX: true
});
$('#ChatBody').scrollTop($('#ChatBody').prop('scrollHeight'));
}
$('.main-chat-list .media').on('click touch', function() {
$(this).addClass('selected').removeClass('new');
$(this).siblings().removeClass('selected');
if (window.matchMedia('(max-width: 991px)').matches) {
$('body').addClass('main-content-body-show');
$('html body').scrollTop($('html body').prop('scrollHeight'));
}
});
$('[data-toggle="tooltip"]').tooltip();
$('#ChatBodyHide').on('click touch', function(e) {
e.preventDefault();
$('body').removeClass('main-content-body-show');
})
});