diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2016-12-09 09:34:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-09 09:34:53 +0300 |
commit | 9227a3a695aa8db3291e3fd994c9a7733ee643bf (patch) | |
tree | f4afa72ab0fc0cf1d5707c3960b3244c46e149d6 | |
parent | 4b4b2eb65cef8e90919754aa21243ef4497d31ac (diff) |
Fix propagateNewPage might not actually load the page (#10979)
This is because angular might cancel the url change or listen to it themselves and not reload the page entirely.
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index eecbc79a95..2c6fad9eb5 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -338,6 +338,15 @@ var broadcast = { // Now load the new page. var newUrl = currentSearchStr + currentHashStr; + var $rootScope = piwikHelper.getAngularDependency('$rootScope'); + if ($rootScope) { + $rootScope.$on('$locationChangeStart', function (event) { + if (event) { + event.preventDefault(); + } + }) + } + if (oldUrl == newUrl) { window.location.reload(); } else { |