Sha256: f7ddea1ff2f6491737f47a255a25e0ab981949d13d32514ecca214331440f2fe
Contents?: true
Size: 1.13 KB
Versions: 120
Compression:
Stored size: 1.13 KB
Contents
Spree.ready(function(){ $('body').popover({selector: '.hint-tooltip', html: true, trigger: 'hover', placement: 'top'}); $('body').tooltip({selector: '.with-tip'}); /* * 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.dispose(); 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
120 entries across 120 versions & 2 rubygems