mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
perf: remove createUserTooltips
This commit is contained in:
@@ -209,18 +209,8 @@ app.flags = {};
|
|||||||
.addClass('active');
|
.addClass('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
app.createUserTooltips = function (els, placement) {
|
app.createUserTooltips = function () {
|
||||||
if (isTouchDevice) {
|
console.warn('[removed] app.creatUserTooltips is removed');
|
||||||
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 () {
|
app.createStatusTooltips = function () {
|
||||||
@@ -234,15 +224,9 @@ app.flags = {};
|
|||||||
|
|
||||||
app.processPage = function () {
|
app.processPage = function () {
|
||||||
highlightNavigationLink();
|
highlightNavigationLink();
|
||||||
|
|
||||||
$('.timeago').timeago();
|
$('.timeago').timeago();
|
||||||
|
|
||||||
utils.makeNumbersHumanReadable($('.human-readable-number'));
|
utils.makeNumbersHumanReadable($('.human-readable-number'));
|
||||||
|
|
||||||
utils.addCommasToNumbers($('.formatted-number'));
|
utils.addCommasToNumbers($('.formatted-number'));
|
||||||
|
|
||||||
app.createUserTooltips($('#content'));
|
|
||||||
|
|
||||||
app.createStatusTooltips();
|
app.createStatusTooltips();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll', '
|
|||||||
$('[component="posts"]').append(html);
|
$('[component="posts"]').append(html);
|
||||||
html.find('img:not(.not-responsive)').addClass('img-responsive');
|
html.find('img:not(.not-responsive)').addClass('img-responsive');
|
||||||
html.find('.timeago').timeago();
|
html.find('.timeago').timeago();
|
||||||
app.createUserTooltips();
|
|
||||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
hooks.fire('action:posts.loaded', { posts: posts });
|
hooks.fire('action:posts.loaded', { posts: posts });
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ define('forum/account/topics', [
|
|||||||
app.parseAndTranslate(template, 'topics', { topics: topics }, function (html) {
|
app.parseAndTranslate(template, 'topics', { topics: topics }, function (html) {
|
||||||
$('[component="category"]').append(html);
|
$('[component="category"]').append(html);
|
||||||
html.find('.timeago').timeago();
|
html.find('.timeago').timeago();
|
||||||
app.createUserTooltips();
|
|
||||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
hooks.fire('action:topics.loaded', { topics: topics });
|
hooks.fire('action:topics.loaded', { topics: topics });
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ define('forum/categories', ['components', 'categorySelector', 'hooks'], function
|
|||||||
}
|
}
|
||||||
|
|
||||||
html.fadeIn();
|
html.fadeIn();
|
||||||
|
|
||||||
app.createUserTooltips();
|
|
||||||
html.find('.timeago').timeago();
|
html.find('.timeago').timeago();
|
||||||
|
|
||||||
if (category.find('[component="category/posts"]').length > parseInt(numRecentReplies, 10)) {
|
if (category.find('[component="category/posts"]').length > parseInt(numRecentReplies, 10)) {
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ define('forum/category', [
|
|||||||
html.find('.timeago').timeago();
|
html.find('.timeago').timeago();
|
||||||
$('[component="category/subcategory/container"]').append(html);
|
$('[component="category/subcategory/container"]').append(html);
|
||||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
app.createUserTooltips(html);
|
|
||||||
ajaxify.data.nextSubCategoryStart += ajaxify.data.subCategoriesPerPage;
|
ajaxify.data.nextSubCategoryStart += ajaxify.data.subCategoriesPerPage;
|
||||||
ajaxify.data.subCategoriesLeft -= data.length;
|
ajaxify.data.subCategoriesLeft -= data.length;
|
||||||
btn.toggleClass('hidden', ajaxify.data.subCategoriesLeft <= 0)
|
btn.toggleClass('hidden', ajaxify.data.subCategoriesLeft <= 0)
|
||||||
|
|||||||
@@ -370,9 +370,6 @@ define('forum/topic/posts', [
|
|||||||
|
|
||||||
Posts.onNewPostsAddedToDom = function (posts) {
|
Posts.onNewPostsAddedToDom = function (posts) {
|
||||||
Posts.onTopicPageLoad(posts);
|
Posts.onTopicPageLoad(posts);
|
||||||
|
|
||||||
app.createUserTooltips(posts);
|
|
||||||
|
|
||||||
utils.addCommasToNumbers(posts.find('.formatted-number'));
|
utils.addCommasToNumbers(posts.find('.formatted-number'));
|
||||||
utils.makeNumbersHumanReadable(posts.find('.human-readable-number'));
|
utils.makeNumbersHumanReadable(posts.find('.human-readable-number'));
|
||||||
posts.find('.timeago').timeago();
|
posts.find('.timeago').timeago();
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ define('chat', [
|
|||||||
app.parseAndTranslate('partials/chats/dropdown', { rooms: rooms }, function (html) {
|
app.parseAndTranslate('partials/chats/dropdown', { rooms: rooms }, function (html) {
|
||||||
chatsListEl.find('*').not('.navigation-link').remove();
|
chatsListEl.find('*').not('.navigation-link').remove();
|
||||||
chatsListEl.prepend(html);
|
chatsListEl.prepend(html);
|
||||||
app.createUserTooltips(chatsListEl, 'right');
|
|
||||||
chatsListEl.off('click').on('click', '[data-roomid]', function (ev) {
|
chatsListEl.off('click').on('click', '[data-roomid]', function (ev) {
|
||||||
if ($(ev.target).parents('.user-link').length) {
|
if ($(ev.target).parents('.user-link').length) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -262,7 +262,6 @@ define('topicList', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
html.find('.timeago').timeago();
|
html.find('.timeago').timeago();
|
||||||
app.createUserTooltips(html);
|
|
||||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||||
hooks.fire('action:topics.loaded', { topics: topics, template: templateName });
|
hooks.fire('action:topics.loaded', { topics: topics, template: templateName });
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
Reference in New Issue
Block a user