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:
authormattab <matthieu.aubry@gmail.com>2015-11-26 07:13:53 +0300
committermattab <matthieu.aubry@gmail.com>2015-11-26 07:13:53 +0300
commit522cde2aa22ac67e12fa0005a1a04b40d0ba16b5 (patch)
treece09f5cb5bb0b876e42f1a2baa74e5eb376aeb6b /plugins/CoreHome/javascripts/dataTable.js
parent926af9c74c67afc924e60fd6619ca499d1baab58 (diff)
Add 'all' in the Row count selector to be able to display all rows, and optionally export them all
Diffstat (limited to 'plugins/CoreHome/javascripts/dataTable.js')
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 0232d91ec6..56837809fc 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -506,13 +506,20 @@ $.extend(DataTable.prototype, UIControl.prototype, {
};
}
+ function getFilterLimitAsString(limit) {
+ if (limit == '-1') {
+ return _pk_translate('General_All').toLowerCase();
+ }
+ return limit;
+ }
+
// setup limit control
- $('.limitSelection', domElem).append('<div><span>' + self.param[limitParamName] + '</span></div><ul></ul>');
+ $('.limitSelection', domElem).append('<div><span value="'+ self.param[limitParamName] +'">' + getFilterLimitAsString(self.param[limitParamName]) + '</span></div><ul></ul>');
if (self.props.show_limit_control) {
$('.limitSelection ul', domElem).hide();
for (var i = 0; i < numbers.length; i++) {
- $('.limitSelection ul', domElem).append('<li value="' + numbers[i] + '"><span>' + numbers[i] + '</span></li>');
+ $('.limitSelection ul', domElem).append('<li value="' + numbers[i] + '"><span>' + getFilterLimitAsString(numbers[i]) + '</span></li>');
}
$('.limitSelection ul li:last', domElem).addClass('last');
@@ -535,12 +542,12 @@ $.extend(DataTable.prototype, UIControl.prototype, {
$('.limitSelection', domElem).is('.visible') ? hide() : show();
});
$('.limitSelection ul li', domElem).on('click', function (event) {
- var limit = parseInt($(event.target).text());
+ var limit = parseInt($(event.target).closest('li').attr('value'));
hide();
if (limit != self.param[limitParamName]) {
setLimitValue(self.param, limit);
- $('.limitSelection>div>span', domElem).text(limit);
+ $('.limitSelection>div>span', domElem).text( getFilterLimitAsString(limit)).attr('value', limit);
self.reloadAjaxDataTable();
var data = {};
@@ -1045,7 +1052,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
$(this).attr('href', function () {
var url = $(this).attr('href') + '&token_auth=' + piwik.token_auth;
- var limit = $('.limitSelection>div>span', domElem).text();
+ var limit = $('.limitSelection>div>span', domElem).attr('value');
var defaultLimit = $(this).attr('filter_limit');
if (!limit || 'undefined' === limit || defaultLimit == -1) {
limit = defaultLimit;