Revert "perf: remove createUserTooltips"

This reverts commit facc10e40f.
This commit is contained in:
Barış Soner Uşaklı
2021-11-13 20:16:24 -05:00
parent d7c2a311ab
commit 7f8783555b
8 changed files with 28 additions and 2 deletions

View File

@@ -209,8 +209,18 @@ app.flags = {};
.addClass('active');
}
app.createUserTooltips = function () {
console.warn('[removed] app.creatUserTooltips is removed');
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').each(function () {
$(this).tooltip({
placement: placement || $(this).attr('title-placement') || 'top',
title: $(this).attr('title'),
container: '#content',
});
});
};
app.createStatusTooltips = function () {
@@ -224,9 +234,15 @@ app.flags = {};
app.processPage = function () {
highlightNavigationLink();
$('.timeago').timeago();
utils.makeNumbersHumanReadable($('.human-readable-number'));
utils.addCommasToNumbers($('.formatted-number'));
app.createUserTooltips($('#content'));
app.createStatusTooltips();
};