diff options
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/build/app.js b/js/build/app.js index fbd3d7e7e..ad93b6f43 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -2211,19 +2211,24 @@ app.directive('newsTimeout', ["$timeout", "$rootScope", function ($timeout, $roo 'newsTimeout': '&' }, link: function (scope, element) { + var destroyed = false; var seconds = 7; var timer = $timeout(scope.newsTimeout, seconds * 1000); // remove timeout if element is being removed by // for instance clicking on the x button - scope.$on('$destroy', function () { + element.on('$destroy', function () { $timeout.cancel(timer); }); // also delete the entry if undo is ignored and the url // is changed $rootScope.$on('$locationChangeStart', function () { - element.remove(); + if (!destroyed) { + destroyed = true; + element.remove(); + scope.newsTimeout(); + } }); } }; |