Only use JS tooltips when non-native tooltip behavior is required
Only display JS tooltips when there are specific requirements for delay, there is a specific alignment or HTML markup can be rendered in the tooltip. fixes #9025
This commit is contained in:
parent
8dba5752dc
commit
ce6be0cc0f
|
@ -31,15 +31,25 @@
|
|||
$('i[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
|
||||
$('[title]', el).each(function (i, el) {
|
||||
var $el = $(el);
|
||||
var delay = 500;
|
||||
var delay, gravity;
|
||||
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 });
|
||||
if (delay === undefined &&
|
||||
gravity === undefined &&
|
||||
!$el.data('title-rich')) {
|
||||
// use native tooltips for everything that doesn't
|
||||
// require specific behavior or html markup
|
||||
return;
|
||||
}
|
||||
delay = delay === undefined ? 500 : delay;
|
||||
$el.tipsy({
|
||||
gravity: gravity || $.fn.tipsy.autoNS,
|
||||
delayIn: delay
|
||||
});
|
||||
});
|
||||
|
||||
// migrate or remove all orphaned tooltips
|
||||
|
|
Loading…
Reference in New Issue