diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-07-05 14:19:12 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-07-05 14:19:20 +0200 |
commit | 24114249513c15c69c5f240c9210a49c589bdd19 (patch) | |
tree | ea83640c4c781fea1a60fba7f25331628cf4d9de | |
parent | 4e5ab402456426c8d620221554a46e8a88deaabf (diff) |
make it possible to turn off mark read by scrolling
-rw-r--r-- | js/app/directives/newsitemscroll.coffee | 4 | ||||
-rw-r--r-- | js/public/app.js | 2 | ||||
-rw-r--r-- | templates/main.php | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/js/app/directives/newsitemscroll.coffee b/js/app/directives/newsitemscroll.coffee index 5d8345999..f0cf69543 100644 --- a/js/app/directives/newsitemscroll.coffee +++ b/js/app/directives/newsitemscroll.coffee @@ -37,7 +37,9 @@ angular.module('News').directive 'newsItemScroll', ['$rootScope', 'Config', scrolling = true , Config.ScrollTimeout - if markingRead + # dont scroll if the value is set to false or there is already + # a mark read request + if markingRead and elm.attr('news-item-scroll') == 'true' markingRead = false setTimeout -> markingRead = true diff --git a/js/public/app.js b/js/public/app.js index c345d54d5..680a411ad 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -285,7 +285,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. setTimeout(function() { return scrolling = true; }, Config.ScrollTimeout); - if (markingRead) { + if (markingRead && elm.attr('news-item-scroll') === 'true') { markingRead = false; setTimeout(function() { var $elems, feedItem, id, offset, _i, _len, _results; diff --git a/templates/main.php b/templates/main.php index 22a7fec5d..35c8e31a5 100644 --- a/templates/main.php +++ b/templates/main.php @@ -49,7 +49,7 @@ autopaging: isAutoPaging() }" ng-controller="ItemController" - news-item-scroll + news-item-scroll="true" item-shortcuts tabindex="-1"> <?php print_unescaped($this->inc("part.items")); ?> |