diff options
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/js/build/app.js b/js/build/app.js index 9ca4def23..442f2095e 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -2019,6 +2019,33 @@ app.directive('newsFocus', ["$timeout", "$interpolate", function ($timeout, $int }; }]); +app.directive('newsPullToRefresh', ["$route", "$rootScope", function ($route, $rootScope) { + 'use strict'; + + var scrolled = false; + + return { + restrict: 'A', + scope: { + 'newsTimeout': '&' + }, + link: function (scope, element) { + + // change in the route means the content is refreshed + // so reset the var + $rootScope.$on('$routeChangeStart', function () { + scrolled = false; + }); + + element.on('scroll', function () { + if (element.scrollTop() === 0 && scrolled) { + $route.reload(); + } + scrolled = true; + }); + } + }; +}]); app.directive('newsReadFile', function () { 'use strict'; @@ -2180,7 +2207,8 @@ app.directive('newsTimeout', ["$timeout", "$rootScope", function ($timeout, $roo $timeout.cancel(timer); }); - // route change also triggers the timeout + // also delete the entry if undo is ignored and the url + // is changed $rootScope.$on('$locationChangeStart', function () { element.remove(); }); |