1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-12-26 17:38:21 +01:00

Merge pull request #32 from lxsang/master

fix scrolldown bug
This commit is contained in:
Xuan Sang LE 2020-12-09 11:55:03 +01:00 committed by GitHub
commit 47eab0a1dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,7 @@
$(document).ready(function() {
var options = {
target: "quick_talk_comment_thread",
page: "desktop",
api_uri: "https://chat.iohub.dev/comment",
uri: "<?=url?>",
author: {

View File

@ -4,6 +4,9 @@ class QuickTalk {
if (typeof this.options.target === "string") {
this.options.target = document.getElementById(this.options.target);
}
if (typeof this.options.page && typeof this.options.page === "string") {
this.options.page = document.getElementById(this.options.page);
}
this.preview_on = false;
this.instant_compose = undefined;
let editor = document.createElement("div");
@ -196,6 +199,9 @@ class QuickTalk {
container.appendChild(preview);
container.appendChild(footer);
at.appendChild(container);
if (this.options.page) {
this.options.page.scrollTop = this.options.page.scrollHeight;
}
//container.scrollIntoView();
return container;
}