Sha256: b8a968c01c6329cf05dfe50d6874cfbbaa5c4250ba140faf91612e802d3e32a5

Contents?: true

Size: 616 Bytes

Versions: 7

Compression:

Stored size: 616 Bytes

Contents

sitemap.behavior = sitemap.behavior || {};

sitemap.behavior.tooltipTarget = function(translationKey) {
  function behavior(g) {
    g
      .on('mouseover.tooltipTarget', function() {
        var rect = d3.event.target.getBoundingClientRect();

        $(d3.event.target).trigger('requesttooltip', [{
          translationKey: translationKey,
          position: {
            left: rect.right,
            top: rect.top + rect.height / 2
          }
        }]);
      })
      .on('mouseout.tooltipTarget', function() {
        $(d3.event.target).trigger('resettooltip');
      })
    ;
  }

  return behavior;
};

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-sitemap-1.5.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js
pageflow-sitemap-1.4.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js
pageflow-sitemap-1.3.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js
pageflow-sitemap-1.2.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js
pageflow-sitemap-1.1.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js
pageflow-sitemap-1.0.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js
pageflow-sitemap-0.1.0 app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js