aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat/chat_layout_utils.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2020-11-06 12:55:57 +0000
committerShpuld Shpludson <shp@cock.li>2020-11-06 12:55:57 +0000
commit60983ae42b584694de0211ca67ef72d492a293c9 (patch)
tree61f09d9cf2e9fc80142f1b903198eed24d46ca90 /src/components/chat/chat_layout_utils.js
parentdbeecd18acfc14920c49324e08600dadba7127d7 (diff)
parent15ea9d8c917d6d0408a9c48f38976d19f9936054 (diff)
Merge branch 'chat-fix-for-vertical-screen' into 'develop'
Chat scroll fix for vertical screen Closes #997 See merge request pleroma/pleroma-fe!1277
Diffstat (limited to 'src/components/chat/chat_layout_utils.js')
-rw-r--r--src/components/chat/chat_layout_utils.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components/chat/chat_layout_utils.js b/src/components/chat/chat_layout_utils.js
index 609dc0c9..50a933ac 100644
--- a/src/components/chat/chat_layout_utils.js
+++ b/src/components/chat/chat_layout_utils.js
@@ -24,3 +24,10 @@ export const isBottomedOut = (el, offset = 0) => {
export const scrollableContainerHeight = (inner, header, footer) => {
return inner.offsetHeight - header.clientHeight - footer.clientHeight
}
+
+// Returns whether or not the scrollbar is visible.
+export const isScrollable = (el) => {
+ if (!el) return
+
+ return el.scrollHeight > el.clientHeight
+}