diff options
author | diosmosis <benaka@piwik.pro> | 2015-05-09 10:46:01 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-05-13 08:23:42 +0300 |
commit | a53ae704fecf5fb8c991b8f52275c7327429515f (patch) | |
tree | 64a870e4b75f3cf1531c747b6959504e49718a49 /plugins/CoreHome/javascripts/broadcast.js | |
parent | d3d43cd105870d3aacaa70547e7ce607b669060b (diff) |
Refs #7798, proof of concept fix for history plugin's scroll to top issue. Fix involves using angular service that uses the singleton instead of jquery's history plugin. Can remove the history plugin after this change.
Diffstat (limited to 'plugins/CoreHome/javascripts/broadcast.js')
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index aaad2bd708..5ada120a6b 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -54,9 +54,9 @@ var broadcast = { } broadcast._isInit = true; - // Initialize history plugin. - // The callback is called at once by present location.hash - $.history.init(broadcast.pageload, {unescape: true}); + angular.element(document).injector().invoke(function (historyService) { + historyService.init(); + }); if(noLoadingMessage != true) { piwikHelper.showAjaxLoading(); @@ -222,7 +222,9 @@ var broadcast = { else { // Let history know about this new Hash and load it. broadcast.forceReload = true; - $.history.load(currentHashStr); + angular.element(document).injector().invoke(function (historyService) { + historyService.load(currentHashStr); + }); } }, @@ -378,7 +380,9 @@ var broadcast = { } broadcast.forceReload = false; - $.history.load(newHash); + angular.element(document).injector().invoke(function (historyService) { + historyService.load(newHash); + }); }, /** |