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()
|
@scrollToBottom()
|
||||||
|
|
||||||
detectScrolledtoBottom: =>
|
detectScrolledtoBottom: =>
|
||||||
scrollBottom = @scrollHolder.scrollTop() + @scrollHolder.height()
|
scrollBottom = @scrollHolder.scrollTop() + @scrollHolder.outerHeight()
|
||||||
@scrolledToBottom = Math.abs(scrollBottom - @scrollHolder.prop('scrollHeight')) <= @scrollSnapTolerance
|
@scrolledToBottom = Math.abs(scrollBottom - @scrollHolder.prop('scrollHeight')) <= @scrollSnapTolerance
|
||||||
|
@scrollHint.addClass('is-hidden') if @scrolledToBottom
|
||||||
|
|
||||||
showScrollHint: ->
|
showScrollHint: ->
|
||||||
@scrollHint.removeClass('is-hidden')
|
@scrollHint.removeClass('is-hidden')
|
||||||
|
@ -696,7 +697,6 @@ class ChatWindow extends App.Controller
|
||||||
onScrollHintClick: ->
|
onScrollHintClick: ->
|
||||||
# animate scroll
|
# animate scroll
|
||||||
@scrollHolder.animate({scrollTop: @scrollHolder.prop('scrollHeight')}, 300)
|
@scrollHolder.animate({scrollTop: @scrollHolder.prop('scrollHeight')}, 300)
|
||||||
@scrollHint.addClass('is-hidden')
|
|
||||||
|
|
||||||
scrollToBottom: ({ showHint } = { showHint: false }) ->
|
scrollToBottom: ({ showHint } = { showHint: false }) ->
|
||||||
if @scrolledToBottom
|
if @scrolledToBottom
|
||||||
|
|
Loading…
Reference in a new issue