summaryrefslogtreecommitdiffstats
path: root/js/app
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-08-01 16:06:19 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-08-01 16:06:19 +0200
commit01e7467c0b559203e9af38e682af2681ffa0aa46 (patch)
tree4f0363baab6043d2d582781dc4b9673cd86bec59 /js/app
parentcdf3fd3b91ead90aba37d9a5e0cb3f0c68101f9c (diff)
also scroll correctly to bottom in firefox
Diffstat (limited to 'js/app')
-rw-r--r--js/app/directives/newsclickscroll.coffee9
1 files changed, 5 insertions, 4 deletions
diff --git a/js/app/directives/newsclickscroll.coffee b/js/app/directives/newsclickscroll.coffee
index 6194d5103..b7ca98757 100644
--- a/js/app/directives/newsclickscroll.coffee
+++ b/js/app/directives/newsclickscroll.coffee
@@ -26,13 +26,14 @@ angular.module('News').directive 'newsClickScroll', ['$timeout', ($timeout) ->
elm.click ->
scrollArea = $(options.scrollArea)
direction = options.direction
- if direction == 'top'
- scrollPosition = 0
- else
- scrollPosition = scrollArea[0].scrollHeight
# do this to execute after rendering
$timeout ->
+ if direction == 'top'
+ scrollPosition = 0
+ else
+ scrollPosition = scrollArea.prop('scrollHeight')
+
scrollArea.scrollTop(scrollPosition)
, 10
] \ No newline at end of file