Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2017-10-06 06:28:23 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2017-10-06 06:28:23 +0300
commitc78f973545b7c0190aeaf0cdd50a1d629a15afad (patch)
tree35d58174e4231b2b82e98fb2ba70d91ccb76f0c9
parent43e14ed09d4d81219c16c1ec7b54f152f110e99f (diff)
fixes js memory leak (#12130)
-rw-r--r--plugins/Dashboard/angularjs/dashboard/dashboard.directive.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js b/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js
index 04c1a8e6a5..141be1a97d 100644
--- a/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js
+++ b/plugins/Dashboard/angularjs/dashboard/dashboard.directive.js
@@ -38,7 +38,9 @@
name: dashboard ? dashboard.name : ''
});
- $('#columnPreview').find('>div').each(function () {
+ var divElements = $('#columnPreview').find('>div');
+
+ divElements.each(function () {
var width = [];
$('div', this).each(function () {
width.push(this.className.replace(/width-/, ''));
@@ -46,8 +48,9 @@
$(this).attr('layout', width.join('-'));
});
- $('#columnPreview').find('>div').on('click', function () {
- $('#columnPreview').find('>div').removeClass('choosen');
+ divElements.off('click.renderDashboard');
+ divElements.on('click.renderDashboard', function () {
+ divElements.removeClass('choosen');
$(this).addClass('choosen');
});
}