mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-06 23:27:56 +02:00
tooltip fixes
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
|
||||
"moderator_tools": "Moderator Tools",
|
||||
|
||||
"status": "Status",
|
||||
"online": "Online",
|
||||
"away": "Away",
|
||||
"dnd": "Do not disturb",
|
||||
|
||||
@@ -238,25 +238,14 @@ if (document.readyState === 'loading') {
|
||||
}
|
||||
|
||||
app.createUserTooltips = function (els, placement) {
|
||||
if (isTouchDevice) {
|
||||
return;
|
||||
}
|
||||
els = els || $('body');
|
||||
els.find('.avatar,img[title].teaser-pic,img[title].user-img,div.user-icon,span.user-icon').one('mouseenter', function (ev) {
|
||||
const $this = $(this);
|
||||
const title = $this.attr('title');
|
||||
if (!title) {
|
||||
return;
|
||||
}
|
||||
// perf: create tooltips on demand
|
||||
$this.tooltip({
|
||||
placement: placement || $this.attr('title-placement') || 'top',
|
||||
title: $this.attr('title'),
|
||||
if (!isTouchDevice) {
|
||||
els = els || $('body');
|
||||
els.tooltip({
|
||||
selector: '.avatar',
|
||||
placement: placement || 'top',
|
||||
container: '#content',
|
||||
});
|
||||
// this will cause the tooltip to show up
|
||||
$this.trigger(ev);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
app.createStatusTooltips = function () {
|
||||
|
||||
@@ -43,12 +43,11 @@ define('forum/header', [
|
||||
if (env === 'xs' || env === 'sm' || utils.isTouchDevice()) {
|
||||
return;
|
||||
}
|
||||
$('#header-menu #main-nav li[title]').each(function () {
|
||||
$(this).tooltip({
|
||||
placement: 'bottom',
|
||||
trigger: 'hover',
|
||||
title: $(this).attr('title'),
|
||||
});
|
||||
|
||||
$('#header-menu #main-nav').tooltip({
|
||||
selector: '.nav-item',
|
||||
placement: 'bottom',
|
||||
trigger: 'hover',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user