Fix append scrolling -- needs more testing
This commit is contained in:
parent
ab1bd6415d
commit
b1ab4dd667
1 changed files with 5 additions and 5 deletions
|
|
@ -257,14 +257,15 @@ function onText(args, kwargs) {
|
||||||
if( SplitHandler ) {
|
if( SplitHandler ) {
|
||||||
for ( var key in SplitHandler.split_panes) {
|
for ( var key in SplitHandler.split_panes) {
|
||||||
var pane = SplitHandler.split_panes[key];
|
var pane = SplitHandler.split_panes[key];
|
||||||
console.log(pane);
|
|
||||||
// is this message type mapped to this pane?
|
// is this message type mapped to this pane?
|
||||||
if ( (pane['types'].length > 0) && pane['types'].includes(msgtype) ) {
|
if ( (pane['types'].length > 0) && pane['types'].includes(msgtype) ) {
|
||||||
// yes, so append/replace this pane's inner div with this message
|
// yes, so append/replace this pane's inner div with this message
|
||||||
if ( pane['update_method'] == 'replace' ) {
|
if ( pane['update_method'] == 'replace' ) {
|
||||||
$('#'+key).html(args[0])
|
$('#'+key).html(args[0])
|
||||||
} else {
|
} else {
|
||||||
$('#'+key).append(args[0]).animate({ scrollTop: document.getElementById("#"+key).scrollHeight }, 0);
|
$('#'+key).append(args[0]);
|
||||||
|
var scrollHeight = $('#'+key).parent().prop("scrollHeight");
|
||||||
|
$('#'+key).parent().animate({ scrollTop: scrollHeight }, 0);
|
||||||
}
|
}
|
||||||
// record sending this message to a pane, no need to update the default div
|
// record sending this message to a pane, no need to update the default div
|
||||||
use_default_pane = false;
|
use_default_pane = false;
|
||||||
|
|
@ -279,9 +280,8 @@ function onText(args, kwargs) {
|
||||||
var mwin = $("#messagewindow");
|
var mwin = $("#messagewindow");
|
||||||
var cls = kwargs == null ? 'out' : kwargs['cls'];
|
var cls = kwargs == null ? 'out' : kwargs['cls'];
|
||||||
mwin.append("<div class='" + cls + "'>" + args[0] + "</div>");
|
mwin.append("<div class='" + cls + "'>" + args[0] + "</div>");
|
||||||
mwin.animate({
|
var scrollHeight = mwin.parent().parent().prop("scrollHeight");
|
||||||
scrollTop: document.getElementById("messagewindow").scrollHeight
|
mwin.parent().parent().animate({ scrollTop: scrollHeight }, 0);
|
||||||
}, 0);
|
|
||||||
|
|
||||||
onNewLine(args[0], null);
|
onNewLine(args[0], null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue