customer chat: add scroll snap tolerance
This commit is contained in:
parent
f62796ab9e
commit
74b9e60ad6
2 changed files with 3 additions and 2 deletions
|
@ -367,6 +367,7 @@ class ChatWindow extends App.Controller
|
||||||
@isAgentTyping = false
|
@isAgentTyping = false
|
||||||
@resetUnreadMessages()
|
@resetUnreadMessages()
|
||||||
@scrolledToBottom = true
|
@scrolledToBottom = true
|
||||||
|
@scrollSnapTolerance = 10 # pixels
|
||||||
|
|
||||||
@chat = App.Chat.find(@session.chat_id)
|
@chat = App.Chat.find(@session.chat_id)
|
||||||
@name = "#{@chat.displayName()} ##{@session.id}"
|
@name = "#{@chat.displayName()} ##{@session.id}"
|
||||||
|
@ -682,7 +683,7 @@ class ChatWindow extends App.Controller
|
||||||
|
|
||||||
detectScrolledtoBottom: =>
|
detectScrolledtoBottom: =>
|
||||||
scrollBottom = @scrollHolder.scrollTop() + @scrollHolder.height()
|
scrollBottom = @scrollHolder.scrollTop() + @scrollHolder.height()
|
||||||
@scrolledToBottom = scrollBottom == @scrollHolder.prop('scrollHeight')
|
@scrolledToBottom = Math.abs(scrollBottom - @scrollHolder.prop('scrollHeight')) <= @scrollSnapTolerance
|
||||||
|
|
||||||
onScrollHintClick: ->
|
onScrollHintClick: ->
|
||||||
# animate scroll
|
# animate scroll
|
||||||
|
|
|
@ -7833,7 +7833,7 @@ output {
|
||||||
|
|
||||||
.chat-footer {
|
.chat-footer {
|
||||||
border-top: 1px solid hsl(0,0%,93%);
|
border-top: 1px solid hsl(0,0%,93%);
|
||||||
padding: 10px;
|
padding: 10px 10px 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
|
|
Loading…
Reference in a new issue