makes tooltip behaviour more reliable and less erratic

This commit is contained in:
Zanz2 2018-09-16 21:34:36 +02:00
parent 07757e382a
commit 5b955da74c

View file

@ -4,6 +4,8 @@
$.initTooltips = function() {
if ($(document.body).data("tooltips-enabled") === true || $(document.body).data("tooltips-enabled") == null) {
var popoversArray = [];
var leaveTimeout;
var enterTimeout
$('.tooltip_open').remove(); // Destroy all (if any) old open popovers
$('.help_tooltips').each(function(i, obj) {
var popoverObject = obj;
@ -36,13 +38,15 @@
}
});
}).off("mouseleave").on("mouseleave", function( ) {
setTimeout(function() {
if (!$(".tooltip_" + i + "_window:hover").length) {
clearTimeout(enterTimeout);
leaveTimeout = setTimeout(function() {
if (!$(".tooltip_" + i + "_window:hover").length > 0) {
$(obj).popover("hide");
}
}, 100);
}).off("mouseenter").on("mouseenter", function() {
setTimeout(function() {
clearTimeout(leaveTimeout);
enterTimeout = setTimeout(function() {
if ($(obj).hover().length > 0) {
$(obj).popover("show");
$(".tooltip_" + i + "_window").removeClass("tooltip-enter");