fix: persona tooltip so it doesn't appear when dropdowns are open

This commit is contained in:
Barış Soner Uşaklı
2025-04-26 20:44:35 -04:00
parent 7f533167ee
commit ea9f7903ef
2 changed files with 18 additions and 6 deletions

View File

@@ -110,7 +110,7 @@
"nodebb-theme-harmony": "2.1.10",
"nodebb-theme-lavender": "7.1.18",
"nodebb-theme-peace": "2.2.40",
"nodebb-theme-persona": "14.1.8",
"nodebb-theme-persona": "14.1.9",
"nodebb-widget-essentials": "7.0.36",
"nodemailer": "6.10.1",
"nprogress": "0.2.0",

View File

@@ -44,12 +44,24 @@ define('forum/header', [
return;
}
$('#header-menu #main-nav').tooltip({
selector: '.nav-item',
placement: 'bottom',
trigger: 'hover',
container: 'body',
// only affects persona, harmony uses a different structure in harmony.js
const tooltipEls = $('#header-menu .nav-item[title]');
tooltipEls.tooltip({
trigger: 'manual',
animation: false,
placement: 'bottom',
});
tooltipEls.on('mouseenter', function (ev) {
const target = $(ev.target);
const isDropdown = target.hasClass('dropdown-menu') || !!target.parents('.dropdown-menu').length;
if (!isDropdown) {
$(this).tooltip('show');
}
});
tooltipEls.on('click mouseleave', function () {
$(this).tooltip('hide');
});
}