mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 19:51:01 +08:00
makes tooltip behaviour more reliable and less erratic
This commit is contained in:
parent
07757e382a
commit
5b955da74c
1 changed files with 8 additions and 4 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue