Add threshold to check if admin log viewer is at bottom

pull/4674/head
edwardmuel 9 years ago committed by GitHub
parent 2511b1c28f
commit 870d42152c
  1. 7
      packages/rocketchat-logger/client/views/viewLogs.coffee

@ -32,8 +32,9 @@ Template.viewLogs.onRendered ->
template = this
template.isAtBottom = ->
if wrapper.scrollTop >= wrapper.scrollHeight - wrapper.clientHeight
template.isAtBottom = (scrollThreshold) ->
if not scrollThreshold? then scrollThreshold = 0
if wrapper.scrollTop + scrollThreshold >= wrapper.scrollHeight - wrapper.clientHeight
newLogs.className = "new-logs not"
return true
return false
@ -43,7 +44,7 @@ Template.viewLogs.onRendered ->
newLogs.className = "new-logs not"
template.checkIfScrollIsAtBottom = ->
template.atBottom = template.isAtBottom()
template.atBottom = template.isAtBottom(100)
readMessage.enable()
readMessage.read()

Loading…
Cancel
Save