Sha256: 965b6627088a302a48f6c5271b88f08032c27cebbfe53926216e9ca1e3685661
Contents?: true
Size: 1.22 KB
Versions: 16
Compression:
Stored size: 1.22 KB
Contents
$(function(){ $('body').popover({selector: '.hint-tooltip', html: true, trigger: 'hover', placement: 'top'}); /* Animation has to be off to work around a bug in bootstrap 4.0.0.alpha6 */ $('body').tooltip({selector: '.with-tip', animation: false}); /* * Poll tooltips to hide them if they are no longer being hovered. * * This is necessary to fix tooltips hanging around after their attached * element has been removed from the DOM (and will therefore receive no * mouseleave event). This may be unnecessary in a future version of * bootstrap, which intends to solve this using MutationObserver. */ var removeDesyncedTooltip = function(tooltip) { var interval = setInterval(function(){ if(!$(tooltip.element).is(":hover")) { tooltip.hide(); clearInterval(interval); } }, 200); $(tooltip.element).on('hidden.bs.tooltip', function(){ clearInterval(interval); }); }; $('body').on('inserted.bs.tooltip', function(e){ var $target = $(e.target); var tooltip = $target.data('bs.tooltip'); removeDesyncedTooltip(tooltip); var $tooltip = $("#" + $target.attr("aria-describedby")); $tooltip.addClass("action-" + $target.data("action")); }); });
Version data entries
16 entries across 16 versions & 1 rubygems