overleaf/services/web/public/coffee/app/directives/scroll.coffee
Henry Oswald 581d9ec925 - hooked up chat throughout the stack
- removed lots of console.logs
- working on the auto scrol, doesn't quite work yet
2014-07-08 10:08:38 +01:00

14 lines
421 B
CoffeeScript

define [
"base"
], (App) ->
App.directive 'scrollToBottomOn', () ->
return {
link: (scope, element, attrs) ->
element = element[0]
eventToScrollOn = attrs.scrollToBottomOn
console.log eventToScrollOn
scope.$on eventToScrollOn, ()->
console.log element.scrollHeight, element.scrollTop
element.scrollTop = element.scrollHeight*4
console.log element.scrollHeight, element.scrollTop
}