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:
authorThomas Steur <thomas.steur@gmail.com>2017-01-31 20:16:48 +0300
committerThomas Steur <thomas.steur@gmail.com>2017-01-31 20:16:48 +0300
commit5a95ddaaa6f70ade28ac8d4431b3daf8ab15bca4 (patch)
treeb4597b8929c6d8879513bbade1d80c801dfc0e81 /plugins/CoreHome/javascripts/dataTable.js
parent4b9708a007afd3fb93207fdd88aa13c4ad5cdce2 (diff)
make piwik faster when having hundreds of rows
Diffstat (limited to 'plugins/CoreHome/javascripts/dataTable.js')
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 763674585d..d11b501168 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -96,6 +96,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
this.workingDivId = this._createDivId();
domElem.attr('id', this.workingDivId);
+ this.maxNumRowsToHandleEvents = 250;
this.loadedSubDataTable = {};
this.isEmpty = $('.pk-emptyDataTable', domElem).length > 0;
this.bindEventsAndApplyStyle(domElem);
@@ -1543,6 +1544,9 @@ $.extend(DataTable.prototype, UIControl.prototype, {
},
handleColumnHighlighting: function (domElem) {
+ if (!this.canHandleRowEvents(domElem)) {
+ return;
+ }
var maxWidth = {};
var currentNthChild = null;
@@ -1715,6 +1719,10 @@ $.extend(DataTable.prototype, UIControl.prototype, {
});
},
+ canHandleRowEvents: function (domElem) {
+ return domElem.find('table > tbody > tr').size() <= this.maxNumRowsToHandleEvents;
+ },
+
handleRowActions: function (domElem) {
this.doHandleRowActions(domElem.find('table > tbody > tr'));
},
@@ -1859,6 +1867,10 @@ $.extend(DataTable.prototype, UIControl.prototype, {
// also used in action data table
doHandleRowActions: function (trs) {
+ if (!trs || trs.length >= this.maxNumRowsToHandleEvents) {
+ return;
+ }
+
var self = this;
var merged = $.extend({}, self.param, self.props);