customer chat: hide scroll-hint when scrolled to bottom
This commit is contained in:
parent
b7a2ba06f1
commit
d002da8a64
1 changed files with 2 additions and 2 deletions
|
@ -685,8 +685,9 @@ class ChatWindow extends App.Controller
|
|||
@scrollToBottom()
|
||||
|
||||
detectScrolledtoBottom: =>
|
||||
scrollBottom = @scrollHolder.scrollTop() + @scrollHolder.height()
|
||||
scrollBottom = @scrollHolder.scrollTop() + @scrollHolder.outerHeight()
|
||||
@scrolledToBottom = Math.abs(scrollBottom - @scrollHolder.prop('scrollHeight')) <= @scrollSnapTolerance
|
||||
@scrollHint.addClass('is-hidden') if @scrolledToBottom
|
||||
|
||||
showScrollHint: ->
|
||||
@scrollHint.removeClass('is-hidden')
|
||||
|
@ -696,7 +697,6 @@ class ChatWindow extends App.Controller
|
|||
onScrollHintClick: ->
|
||||
# animate scroll
|
||||
@scrollHolder.animate({scrollTop: @scrollHolder.prop('scrollHeight')}, 300)
|
||||
@scrollHint.addClass('is-hidden')
|
||||
|
||||
scrollToBottom: ({ showHint } = { showHint: false }) ->
|
||||
if @scrolledToBottom
|
||||
|
|
Loading…
Reference in a new issue