fix bs tooltips, update status tooltips

see https://github.com/twbs/bootstrap/issues/32372
This commit is contained in:
Barış Soner Uşaklı
2022-10-05 10:09:44 -04:00
parent 1d5cc19351
commit cbc632da7d
6 changed files with 21 additions and 3 deletions

View File

@@ -43,7 +43,9 @@ define('admin/dashboard', [
isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
$('[data-bs-toggle="tooltip"]').tooltip();
$('[data-bs-toggle="tooltip"]').tooltip({
animation: false,
});
setupRealtimeButton();
setupGraphs(function () {

View File

@@ -243,6 +243,7 @@ if (document.readyState === 'loading') {
selector: '.avatar',
placement: placement || 'top',
container: '#content',
animation: false,
});
}
};
@@ -252,6 +253,18 @@ if (document.readyState === 'loading') {
$('body').tooltip({
selector: '.fa-circle.status',
placement: 'top',
container: '#content',
animation: false,
});
$('#content').on('inserted.bs.tooltip', function (ev) {
const target = $(ev.target);
if (target.attr('component') === 'user/status') {
const newTitle = target.attr('data-new-title');
if (newTitle) {
$('.tooltip .tooltip-inner').text(newTitle);
}
}
});
}
};
@@ -296,8 +309,7 @@ if (document.readyState === 'loading') {
translator.translate('[[global:' + status + ']]', function (translated) {
el.removeClass('online offline dnd away')
.addClass(status)
.attr('title', translated)
.attr('data-original-title', translated);
.attr('data-new-title', translated)
});
});
};

View File

@@ -24,6 +24,7 @@ define('forum/categories', ['components', 'categorySelector', 'hooks'], function
$('.category-header').tooltip({
placement: 'bottom',
animation: false,
});
};

View File

@@ -49,6 +49,7 @@ define('forum/header', [
placement: 'bottom',
trigger: 'hover',
container: 'body',
animation: false,
});
}

View File

@@ -19,6 +19,7 @@ define('forum/topic/threadTools', [
$('.topic-main-buttons [title]').tooltip({
container: '#content',
animation: false,
});
// function topicCommand(method, path, command, onComplete) {

View File

@@ -199,6 +199,7 @@ app = window.app || {};
reconnectEl.addClass('active').removeClass('hide').tooltip({
placement: 'bottom',
animation: false,
});
}