Add option to change tooltip settings from data attributes

refs #9025
This commit is contained in:
Matthias Jentsch 2015-04-16 18:25:23 +02:00
parent 168577ff33
commit f07c0d83e8
1 changed files with 12 additions and 1 deletions

View File

@ -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 () {