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

Prevent useless ajax requests in live widgets (fixes #7404) #7687

Merged
merged 3 commits into from Apr 16, 2015
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Apr 15, 2015

This PR aims to fix #7404.
I've improved the js code of the live widgets to ensure the elements are still present in body before new ajax calls are triggered. Before there were only checks if the element were still kind of present, which was the case, even when not within the body.

@sgiehl sgiehl added Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Apr 15, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Apr 15, 2015

How about using this alternative to test if the element is in the DOM: http://stackoverflow.com/a/3086084/245552 I'm not sure performance matter that much here but the suggested solution is 2 orders of magnitude faster so why not.

@sgiehl
Copy link
Member Author

sgiehl commented Apr 15, 2015

I'll check/test that tomorrow

@sgiehl
Copy link
Member Author

sgiehl commented Apr 16, 2015

changed!

@mnapoli
Copy link
Contributor

mnapoli commented Apr 16, 2015

👍

mnapoli added a commit that referenced this pull request Apr 16, 2015
Prevent useless ajax requests in live widgets (fixes #7404)
@mnapoli mnapoli merged commit 00209eb into master Apr 16, 2015
@mnapoli mnapoli deleted the 7404 branch April 16, 2015 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants