mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
This commit is contained in:
@@ -157,8 +157,9 @@ app.cacheBuster = null;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
app.createUserTooltips = function() {
|
app.createUserTooltips = function(els) {
|
||||||
$('img[title].teaser-pic,img[title].user-img').each(function() {
|
els = els || $('body');
|
||||||
|
els.find('img[title].teaser-pic,img[title].user-img').each(function() {
|
||||||
$(this).tooltip({
|
$(this).tooltip({
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
title: $(this).attr('title')
|
title: $(this).attr('title')
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ define('forum/topic/posts', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeAlreadyAddedPosts() {
|
function removeAlreadyAddedPosts() {
|
||||||
var newPosts = components.get('topic').find('[data-index][data-index!="0"].new');
|
var newPosts = $('[component="post"].new');
|
||||||
|
|
||||||
if (newPosts.length === data.posts.length) {
|
if (newPosts.length === data.posts.length) {
|
||||||
var allSamePids = true;
|
var allSamePids = true;
|
||||||
@@ -117,7 +117,7 @@ define('forum/topic/posts', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
data.posts = data.posts.filter(function(post) {
|
data.posts = data.posts.filter(function(post) {
|
||||||
return components.get('post', 'pid', post.pid).length === 0;
|
return $('[component="post"][data-pid="' + post.pid + '"]').length === 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ define('forum/topic/posts', [
|
|||||||
components.get('topic').append(html);
|
components.get('topic').append(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
infinitescroll.removeExtra(components.get('post'), direction, 40);
|
infinitescroll.removeExtra($('[component="post"]'), direction, 40);
|
||||||
|
|
||||||
$(window).trigger('action:posts.loaded', {posts: data.posts});
|
$(window).trigger('action:posts.loaded', {posts: data.posts});
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ define('forum/topic/posts', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
Posts.processPage = function(posts) {
|
Posts.processPage = function(posts) {
|
||||||
app.createUserTooltips();
|
app.createUserTooltips(posts);
|
||||||
app.replaceSelfLinks(posts.find('a'));
|
app.replaceSelfLinks(posts.find('a'));
|
||||||
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'));
|
||||||
|
|||||||
Reference in New Issue
Block a user