Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tour.getEngagement is called on every page load #14648

Closed
diosmosis opened this issue Jul 10, 2019 · 4 comments

Comments

@diosmosis
Copy link
Member

commented Jul 10, 2019

The Tour.getEngagement API method is called on every page load (including modals) even if there is no tour widget visible. Shouldn't need to call it this often, instead it should only be used if there's a tour widget visible.

@diosmosis diosmosis added this to the 3.11.0 milestone Jul 10, 2019

@tsteur

This comment has been minimized.

Copy link
Member

commented Jul 10, 2019

@diosmosis there is no such API. I suppose you mean a different API?

@diosmosis

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

@tsteur in plugins/Tour/javascripts/engagement.js there's an AJAX call to Tour.getEngagement (though it looks like it could be a controller method?). That's what I was seeing.

@tsteur

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

Didn't look too much into it but I reckon this is only once the dashboard was opened and it contains the default dashboard. And it should only do it after the window was focused again (like moved to another tab and then back). Might not be big of an issue but ideally definitely should be only executed when we're on the dashboard and when the widget is on the dashboard.

@sgiehl

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

jQuery(window).off('focus.tourEngagement').on('focus.tourEngagement', function () {
tourEngagement.goToPage({{ currentPage|e('js') }});
});

That event isn't actually unloaded when switching the page. So it's executed on every page once the dashboard was loaded with the widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.