summaryrefslogtreecommitdiffstats
path: root/js/build/app.js
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-09-13 14:36:27 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-09-13 14:36:27 +0200
commit11c4b03d70583d8b4c7e7bce408a3c3a3d9c1f17 (patch)
tree4c4148da2a22130974855103397a44e46024609c /js/build/app.js
parente06aaac5120f95212598b54cd1fb6e2513e77b86 (diff)
mark read on scroll
Diffstat (limited to 'js/build/app.js')
-rw-r--r--js/build/app.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/js/build/app.js b/js/build/app.js
index fe60c82a6..7554cfe3b 100644
--- a/js/build/app.js
+++ b/js/build/app.js
@@ -1815,6 +1815,7 @@ app.directive('newsScroll', ["$timeout", function ($timeout) {
return {
restrict: 'A',
scope: {
+ 'newsScroll': '@',
'newsScrollAutoPage': '&',
'newsScrollMarkRead': '&',
'newsScrollEnabledMarkRead': '=',
@@ -1825,6 +1826,11 @@ app.directive('newsScroll', ["$timeout", function ($timeout) {
},
link: function (scope, elem) {
var allowScroll = true;
+ var scrollArea = elem;
+
+ if (scope.newsScroll) {
+ scrollArea = $(scope.newsScroll);
+ }
var scrollTimeout = scope.newsScrollTimeout || 1;
var markReadTimeout = scope.newsScrollMarkReadTimeout || 1;
@@ -1851,14 +1857,13 @@ app.directive('newsScroll', ["$timeout", function ($timeout) {
scope);
}, markReadTimeout*1000);
}
-
};
- elem.on('scroll', scrollHandler);
+ scrollArea.on('scroll', scrollHandler);
// remove scroll handler if element is destroyed
scope.$on('$destroy', function () {
- elem.off('scroll', scrollHandler);
+ scrollArea.off('scroll', scrollHandler);
});
}
};