diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-08-01 16:06:19 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-08-01 16:06:19 +0200 |
commit | 01e7467c0b559203e9af38e682af2681ffa0aa46 (patch) | |
tree | 4f0363baab6043d2d582781dc4b9673cd86bec59 /js/public | |
parent | cdf3fd3b91ead90aba37d9a5e0cb3f0c68101f9c (diff) |
also scroll correctly to bottom in firefox
Diffstat (limited to 'js/public')
-rw-r--r-- | js/public/app.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/public/app.js b/js/public/app.js index 79a30e549..7081004fb 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -327,15 +327,16 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. var options; options = scope.$eval(attr.newsClickScroll); return elm.click(function() { - var direction, scrollArea, scrollPosition; + var direction, scrollArea; scrollArea = $(options.scrollArea); direction = options.direction; - if (direction === 'top') { - scrollPosition = 0; - } else { - scrollPosition = scrollArea[0].scrollHeight; - } return $timeout(function() { + var scrollPosition; + if (direction === 'top') { + scrollPosition = 0; + } else { + scrollPosition = scrollArea.prop('scrollHeight'); + } return scrollArea.scrollTop(scrollPosition); }, 10); }); |