Skip to content

positioning in IE is sometimes not working (with fix inside) #9

@jamjamg

Description

@jamjamg

i noticed, that tooltips get not postioniend correctly in IE (testet with IE9)
my fix to d3-bootstrap-plugins.js would be:

// ...
move_tip = function(selection) {
  var center, offsets;
  center = [0, 0];
  if (options.placement === "mouse") {
    center = d3.mouse(body.node());
  } else {
    offsets = this.ownerSVGElement.getBoundingClientRect();
    center[0] = offsets.left;
    center[1] = offsets.top;
    center[0] += options.position[0];
    center[1] += options.position[1];
    // START OF FIX: in IE window.scrollX and window.scrollY can be undefined
    center[0] += typeof window.scrollX !== 'undefined' ? window.scrollX : 0;
    center[1] += typeof window.scrollY !== 'undefined' ? window.scrollY : 0;
    // END OF FIX
  }
  center[0] += options.displacement[0];
  center[1] += options.displacement[1];
// ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions