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:
Diffstat (limited to 'plugins/CoreHome/javascripts/dataTable.js')
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index 2115626642..35b73de875 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -111,9 +111,22 @@ $.extend(DataTable.prototype, UIControl.prototype, {
this.isEmpty = $('.pk-emptyDataTable', domElem).length > 0;
this.bindEventsAndApplyStyle(domElem);
this._init(domElem);
+ this.enableStickHead(domElem);
this.initialized = true;
+
},
+ enableStickHead: function (domElem) {
+ // Bind to the resize event of the window object
+ $(window).on('resize', function () {
+ var tableScrollerWidth = $(domElem).find('.dataTableScroller').width();
+ var tableWidth = $(domElem).find('table').width();
+ if (tableScrollerWidth < tableWidth) {
+ $('.dataTableScroller').css('overflow-x', 'scroll');
+ }
+ // Invoke the resize event immediately
+ }).resize();
+ },
//function triggered when user click on column sort
onClickSort: function (domElem) {
var self = this;
@@ -1627,10 +1640,12 @@ $.extend(DataTable.prototype, UIControl.prototype, {
top: 0
});
+ $(".dataTable thead").addClass('with-z-index');
tooltip.stop(true, true).fadeIn(250);
},
function () {
- $(this).prev().stop(true, true).fadeOut(400);
+ $(this).prev().stop(true, true).fadeOut(250);
+ $(".dataTable thead").removeClass('with-z-index');
});
});
},