summaryrefslogtreecommitdiffstats
path: root/js/build/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/build/app.js')
-rw-r--r--js/build/app.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/build/app.js b/js/build/app.js
index 3ebe83422..9ca4def23 100644
--- a/js/build/app.js
+++ b/js/build/app.js
@@ -2162,7 +2162,7 @@ app.directive('newsStopPropagation', function () {
}
};
});
-app.directive('newsTimeout', ["$timeout", function ($timeout) {
+app.directive('newsTimeout', ["$timeout", "$rootScope", function ($timeout, $rootScope) {
'use strict';
return {
@@ -2170,7 +2170,7 @@ app.directive('newsTimeout', ["$timeout", function ($timeout) {
scope: {
'newsTimeout': '&'
},
- link: function (scope) {
+ link: function (scope, element) {
var seconds = 7;
var timer = $timeout(scope.newsTimeout, seconds * 1000);
@@ -2179,6 +2179,11 @@ app.directive('newsTimeout', ["$timeout", function ($timeout) {
scope.$on('$destroy', function () {
$timeout.cancel(timer);
});
+
+ // route change also triggers the timeout
+ $rootScope.$on('$locationChangeStart', function () {
+ element.remove();
+ });
}
};
}]);