comparison sat_templates/templates/default/static/chat.js @ 329:6a26c8a43d10

bulma (chat): fix chat: those change are done to have a minimal chat working, but it's really basic. A full-featured chat should come in a future version.
author Goffi <goffi@goffi.org>
date Fri, 07 May 2021 15:38:10 +0200
parents e9f0a4215e46
children
comparison
equal deleted inserted replaced
328:bfb0d5829728 329:6a26c8a43d10
41 }} 41 }}
42 ); 42 );
43 43
44 var mutationCb = function(mutationsList) { 44 var mutationCb = function(mutationsList) {
45 scrollPos = messages.scrollTop + messages.clientHeight; 45 scrollPos = messages.scrollTop + messages.clientHeight;
46 if (messages.lastChild.offsetTop - scrollPos - 10 <= 0) { 46 if (messages.lastChild.offsetTop - scrollPos - 150 <= 0) {
47 // we auto scroll only if we are at the bottom of the page 47 // we auto scroll only if we are at the bottom of the page
48 // else the use is probably checking history 48 // else the use is probably checking history
49 // Note thas this doesn't take margin into account, 49 // Note thas this doesn't take margin into account,
50 // we suppose margin to be 0 for messages children 50 // we suppose margin to be 0 for messages children
51 messages.scrollTop = messages.scrollHeight; 51 messages.scrollTop = messages.scrollHeight;