mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 10:35:55 +01:00
fix: persona tooltip so it doesn't appear when dropdowns are open
This commit is contained in:
@@ -110,7 +110,7 @@
|
|||||||
"nodebb-theme-harmony": "2.1.10",
|
"nodebb-theme-harmony": "2.1.10",
|
||||||
"nodebb-theme-lavender": "7.1.18",
|
"nodebb-theme-lavender": "7.1.18",
|
||||||
"nodebb-theme-peace": "2.2.40",
|
"nodebb-theme-peace": "2.2.40",
|
||||||
"nodebb-theme-persona": "14.1.8",
|
"nodebb-theme-persona": "14.1.9",
|
||||||
"nodebb-widget-essentials": "7.0.36",
|
"nodebb-widget-essentials": "7.0.36",
|
||||||
"nodemailer": "6.10.1",
|
"nodemailer": "6.10.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
|
|||||||
@@ -44,12 +44,24 @@ define('forum/header', [
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#header-menu #main-nav').tooltip({
|
// only affects persona, harmony uses a different structure in harmony.js
|
||||||
selector: '.nav-item',
|
const tooltipEls = $('#header-menu .nav-item[title]');
|
||||||
placement: 'bottom',
|
|
||||||
trigger: 'hover',
|
tooltipEls.tooltip({
|
||||||
container: 'body',
|
trigger: 'manual',
|
||||||
animation: false,
|
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');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user