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>2016-08-29 07:13:24 +0300
committerThomas Steur <thomas.steur@gmail.com>2016-08-29 18:28:55 +0300
commit903b870466b62e8a655a0f6564d052583c0fb7ec (patch)
tree8a25f6c18322aeb0a062840152d259b5ac5265b3 /plugins/CoreHome/javascripts/dataTable.js
parent4c9d1274408fb57d5e0b53dcda425dc4892c7b00 (diff)
fix tests
Diffstat (limited to 'plugins/CoreHome/javascripts/dataTable.js')
-rw-r--r--plugins/CoreHome/javascripts/dataTable.js47
1 files changed, 29 insertions, 18 deletions
diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index e3e6cf456f..9340c64f31 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -1673,29 +1673,40 @@ $.extend(DataTable.prototype, UIControl.prototype, {
var tooltip = th.find('.columnDocumentation');
tooltip.next().hover(function () {
- var left = (-1 * tooltip.outerWidth() / 2) + th.width() / 2;
- var top = -1 * tooltip.outerHeight();
+ var left = (-1 * tooltip.outerWidth() / 2) + th.width() / 2;
+ var top = -1 * tooltip.outerHeight();
- if (th.next().size() == 0) {
- left = (-1 * tooltip.outerWidth()) + th.width() +
- parseInt(th.css('padding-right'), 10);
- }
+ var thPos = th.position();
+ var thPosTop = 0;
- if (th.offset().top + top < 0) {
- top = th.outerHeight();
- }
+ if (thPos && thPos.top) {
+ thPosTop = thPosTop.top;
+ }
- tooltip.css({
- marginLeft: left,
- marginTop: top,
- top: 0
- });
+ // we need to add thPosTop because the parent th is not position:relative. There may be a gap for the
+ // headline
+ top = top + thPosTop;
- tooltip.stop(true, true).fadeIn(250);
- },
- function () {
- $(this).prev().stop(true, true).fadeOut(400);
+ if (th.next().size() == 0) {
+ left = (-1 * tooltip.outerWidth()) + th.width() +
+ parseInt(th.css('padding-right'), 10);
+ }
+
+ if (th.offset().top + top < 0) {
+ top = thPosTop + th.outerHeight();
+ }
+
+ tooltip.css({
+ marginLeft: left,
+ marginTop: top,
+ top: 0
});
+
+ tooltip.stop(true, true).fadeIn(250);
+ },
+ function () {
+ $(this).prev().stop(true, true).fadeOut(400);
+ });
});
},