summaryrefslogtreecommitdiffstats
path: root/js/public/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/public/app.js')
-rw-r--r--js/public/app.js13
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);
});