Skip to content

Commit

Permalink
Merge pull request #38 from dnwick/master
Browse files Browse the repository at this point in the history
Added Mac fix for tooltip
  • Loading branch information
dnwick committed Feb 18, 2016
2 parents 3ccbd72 + 7bac292 commit 1a09e4c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion charts/chart.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ function bindTooltip(div,markType,eventObj, config, metaData, keyList){

if (item != null && item.status != "exit" && item.mark.marktype == markType) {
var canvas = $(".marks")[0];

if($("#wrapper #tip").length) {
$tip.remove();
}
Expand Down Expand Up @@ -206,6 +205,13 @@ function bindTooltip(div,markType,eventObj, config, metaData, keyList){

var canvasWidth = canvas.width;
var canvasHeight = canvas.height;

var el = $('.marks[style*="width"]');

if(el.length > 0){
canvasWidth = parseFloat($(".marks")[0].style.width);
canvasHeight = parseFloat($(".marks")[0].style.height);
}
var dynamicWidth = $tip.width();
var dynamicHeight = $tip.height();

Expand Down
10 changes: 10 additions & 0 deletions dist/VizGrammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,9 @@ function bindTooltip(div,markType,eventObj, config, metaData, keyList){

if (item != null && item.status != "exit" && item.mark.marktype == markType) {
var canvas = $(".marks")[0];
if($("#wrapper #tip").length) {
$tip.remove();
}

$(div).wrap( "<div id='wrapper' style='position: relative'></div>" );

Expand Down Expand Up @@ -1788,6 +1791,13 @@ function bindTooltip(div,markType,eventObj, config, metaData, keyList){

var canvasWidth = canvas.width;
var canvasHeight = canvas.height;

var el = $('.marks[style*="width"]');

if(el.length > 0){
canvasWidth = parseFloat($(".marks")[0].style.width);
canvasHeight = parseFloat($(".marks")[0].style.height);
}
var dynamicWidth = $tip.width();
var dynamicHeight = $tip.height();

Expand Down
Loading

0 comments on commit 1a09e4c

Please sign in to comment.