From b19251e8e4e3cca5bd02f31232fb7076a0d4e500 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 16 Nov 2017 16:26:33 +0800 Subject: [PATCH] update --- bi/core.js | 16 ++++++++-------- dist/bundle.js | 16 ++++++++-------- dist/core.js | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bi/core.js b/bi/core.js index 8fd995d0f..1b676e9ac 100644 --- a/bi/core.js +++ b/bi/core.js @@ -18759,13 +18759,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, { if (!this.has(name)) { this.create(name, text, level, opt.container || context); } - - var offset = context.element.offset(); - var bounds = context.element.bounds(); - if(bounds.height === 0 || bounds.width === 0) { - return; + if (!opt.belowMouse) { + var offset = context.element.offset(); + var bounds = context.element.bounds(); + if (bounds.height === 0 || bounds.width === 0) { + return; + } + var top = offset.top + bounds.height + 5; } - var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); tooltip.element.css({ @@ -18781,8 +18782,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { } if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { y -= tooltip.element.outerHeight() + 15; - top = offset.top - tooltip.element.outerHeight() - 5; - !opt.belowMouse && (y = Math.min(y, top)); + !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5)); } else { !opt.belowMouse && (y = Math.max(y, top)); } diff --git a/dist/bundle.js b/dist/bundle.js index 2df50b9cc..0e9a06660 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -18759,13 +18759,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, { if (!this.has(name)) { this.create(name, text, level, opt.container || context); } - - var offset = context.element.offset(); - var bounds = context.element.bounds(); - if(bounds.height === 0 || bounds.width === 0) { - return; + if (!opt.belowMouse) { + var offset = context.element.offset(); + var bounds = context.element.bounds(); + if (bounds.height === 0 || bounds.width === 0) { + return; + } + var top = offset.top + bounds.height + 5; } - var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); tooltip.element.css({ @@ -18781,8 +18782,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { } if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { y -= tooltip.element.outerHeight() + 15; - top = offset.top - tooltip.element.outerHeight() - 5; - !opt.belowMouse && (y = Math.min(y, top)); + !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5)); } else { !opt.belowMouse && (y = Math.max(y, top)); } diff --git a/dist/core.js b/dist/core.js index 5e008817c..6866d861d 100644 --- a/dist/core.js +++ b/dist/core.js @@ -18759,13 +18759,14 @@ BI.TooltipsController = BI.inherit(BI.Controller, { if (!this.has(name)) { this.create(name, text, level, opt.container || context); } - - var offset = context.element.offset(); - var bounds = context.element.bounds(); - if(bounds.height === 0 || bounds.width === 0) { - return; + if (!opt.belowMouse) { + var offset = context.element.offset(); + var bounds = context.element.bounds(); + if (bounds.height === 0 || bounds.width === 0) { + return; + } + var top = offset.top + bounds.height + 5; } - var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); tooltip.element.css({ @@ -18781,8 +18782,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { } if (y + tooltip.element.outerHeight() > $("body").outerHeight()) { y -= tooltip.element.outerHeight() + 15; - top = offset.top - tooltip.element.outerHeight() - 5; - !opt.belowMouse && (y = Math.min(y, top)); + !opt.belowMouse && (y = Math.min(y, offset.top - tooltip.element.outerHeight() - 5)); } else { !opt.belowMouse && (y = Math.max(y, top)); }