From bfd21ddb94d89bbbc003364bb488ecd4a9b0c0dc Mon Sep 17 00:00:00 2001 From: lxsang Date: Wed, 9 Dec 2020 11:51:59 +0100 Subject: [PATCH] fix scrolldown bug --- blog/views/default/layout.ls | 1 + talk/assets/quicktalk.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/blog/views/default/layout.ls b/blog/views/default/layout.ls index 6ff8199..711c088 100644 --- a/blog/views/default/layout.ls +++ b/blog/views/default/layout.ls @@ -56,6 +56,7 @@ $(document).ready(function() { var options = { target: "quick_talk_comment_thread", + page: "desktop", api_uri: "https://chat.iohub.dev/comment", uri: "", author: { diff --git a/talk/assets/quicktalk.js b/talk/assets/quicktalk.js index 6a594a3..4fb66d8 100644 --- a/talk/assets/quicktalk.js +++ b/talk/assets/quicktalk.js @@ -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; }