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

Fixes js memory leak in dashboard directive #12130

Merged
merged 1 commit into from Oct 6, 2017
Merged

Fixes js memory leak in dashboard directive #12130

merged 1 commit into from Oct 6, 2017

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Sep 27, 2017

fixes #12058

@sgiehl sgiehl added c: Performance For when we could improve the performance / speed of Matomo. 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. labels Sep 27, 2017
@sgiehl sgiehl added this to the 3.2.0 milestone Sep 27, 2017
var width = [];
$('div', this).each(function () {
width.push(this.className.replace(/width-/, ''));
});
$(this).attr('layout', width.join('-'));
});

$('#columnPreview').find('>div').on('click', function () {
divElements.off('click.renderDashboard');
divElements.on('click.renderDashboard', function () {
$('#columnPreview').find('>div').removeClass('choosen');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this also be replaced with divElements?

As long as the events are always rebound when a new element is added there should be no reason not to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. correct. changed it

@mattab mattab merged commit c78f973 into 3.x-dev Oct 6, 2017
@mattab mattab deleted the memoryleak branch October 6, 2017 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. 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.

JavaScript Memory Leak: #columnPreview click handlers
4 participants