Skip to content

Commit

Permalink
Add option to change tooltip settings from data attributes
Browse files Browse the repository at this point in the history
refs #9025
  • Loading branch information
majentsch committed Apr 16, 2015
1 parent 168577f commit f07c0d8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion public/js/icinga/behavior/tooltip.js
Expand Up @@ -30,7 +30,18 @@
$('svg .chart-data', el).tipsy({ gravity: 'se', html: true });
$('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 });
$('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
$('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 });
$('[title]', el).each(function (i, el) {
var $el = $(el);
var delay = 500;
if ($el.data('tooltip-delay') !== undefined) {
delay = $el.data('tooltip-delay');
}
var gravity = $.fn.tipsy.autoNS;
if ($el.data('tooltip-gravity')) {
gravity = $el.data('tooltip-gravity');
}
$el.tipsy({ gravity: gravity, delayIn: delay });
});

// migrate or remove all orphaned tooltips
$('.tipsy').each(function () {
Expand Down

0 comments on commit f07c0d8

Please sign in to comment.