diff options
author | diosmosis <benaka@piwik.pro> | 2015-05-13 10:08:37 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-05-13 10:08:37 +0300 |
commit | dd95e952e773e20f22561f5896be7ff2bc2b4231 (patch) | |
tree | 9003f31bdc2c9862a9867070b7cb7620057aa013 /plugins/Overlay | |
parent | 87686a59a13d1a09fc1797a4943680df45495fe5 (diff) |
Init broadcast + Piwik_Overlay after document is ready so angular app is available.
Diffstat (limited to 'plugins/Overlay')
-rw-r--r-- | plugins/Overlay/javascripts/Piwik_Overlay.js | 2 | ||||
-rw-r--r-- | plugins/Overlay/templates/index.twig | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/plugins/Overlay/javascripts/Piwik_Overlay.js b/plugins/Overlay/javascripts/Piwik_Overlay.js index 0930180ca6..224758534b 100644 --- a/plugins/Overlay/javascripts/Piwik_Overlay.js +++ b/plugins/Overlay/javascripts/Piwik_Overlay.js @@ -170,6 +170,8 @@ var Piwik_Overlay = (function () { // handle hash change broadcast.loadAjaxContent = hashChangeCallback; + + broadcast._isInit = false; broadcast.init(); if (window.location.href.split('#').length == 1) { diff --git a/plugins/Overlay/templates/index.twig b/plugins/Overlay/templates/index.twig index 7c400b9e57..a5ab981c05 100644 --- a/plugins/Overlay/templates/index.twig +++ b/plugins/Overlay/templates/index.twig @@ -63,11 +63,14 @@ </div> <script type="text/javascript"> - var iframeSrc = 'index.php?module=Overlay&action=startOverlaySession&idSite={{ idSite }}&period={{ period }}&date={{ date }}'; - Piwik_Overlay.init(iframeSrc, '{{ idSite }}', '{{ period }}', '{{ date }}'); + broadcast._isInit = true; + $(function () { + var iframeSrc = 'index.php?module=Overlay&action=startOverlaySession&idSite={{ idSite }}&period={{ period }}&date={{ date }}'; + Piwik_Overlay.init(iframeSrc, '{{ idSite }}', '{{ period }}', '{{ date }}'); - Piwik_Overlay_Translations = { - domain: "{{ 'Overlay_Domain'|translate }}" - }; + window.Piwik_Overlay_Translations = { + domain: "{{ 'Overlay_Domain'|translate }}" + }; + }); </script> {% endblock %} |