diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-08-01 23:51:22 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-08-01 23:51:22 +0300 |
commit | 5f452adec15d6c103b3bc810fb17f8378de79452 (patch) | |
tree | 0d33e9f490ef04a11954278870b9170181cc0d30 /plugins/Tour | |
parent | 93ba78ea81a0b38c35c7888b876f53166d46a546 (diff) |
Only refresh engagement widget when it is on the page (#14665)
I double checked it should have been only refreshing when the tour widget in the dashboard was loaded/viewed at least once, and only when focusing the window again (eg switching between developer tools and the browser window or between different tabs). It wasn't loaded on every page load within Matomo.
Diffstat (limited to 'plugins/Tour')
-rw-r--r-- | plugins/Tour/templates/engagement.twig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/Tour/templates/engagement.twig b/plugins/Tour/templates/engagement.twig index 10ca82296e..405e02c0db 100644 --- a/plugins/Tour/templates/engagement.twig +++ b/plugins/Tour/templates/engagement.twig @@ -50,9 +50,11 @@ <p class="tourSuperUserNote">{{ 'Tour_OnlyVisibleToSuperUser'|translate('<a href="https://matomo.org/faq/general/faq_35/" target="_blank" rel="noreferrer noopener">', '</a>')|raw }}</p> <script> jQuery(window).off('focus.tourEngagement').on('focus.tourEngagement', function () { - tourEngagement.goToPage({{ currentPage|e('js') }}); + if (jQuery('#widgetTourgetEngagement').size()) { + tourEngagement.goToPage({{ currentPage|e('js') }}); + } }); </script> {% endif %} -</div>
\ No newline at end of file +</div> |