mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-18 18:40:58 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -386,7 +386,8 @@ define('forum/topic/postTools', [
|
||||
return slug;
|
||||
}
|
||||
const post = button.parents('[data-pid]');
|
||||
if (post.length && !post.hasClass('self-post')) {
|
||||
const isSelfPost = post.hasClass('self-post');
|
||||
if (post.length) {
|
||||
slug = slugify(post.attr('data-username'), true);
|
||||
if (!slug) {
|
||||
if (post.attr('data-uid') !== '0') {
|
||||
@@ -396,7 +397,7 @@ define('forum/topic/postTools', [
|
||||
}
|
||||
}
|
||||
if (slug && slug !== '[[global:former-user]]' && slug !== '[[global:guest]]') {
|
||||
slug = '@' + slug;
|
||||
slug = isSelfPost ? slug : `@${slug}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -377,6 +377,10 @@ define('navigator', [
|
||||
|
||||
function toggleAnchor(text) {
|
||||
anchorEl.innerText = text;
|
||||
anchorEl.style.display = text ? 'inline' : 'none';
|
||||
if (text) {
|
||||
translator.translate(text).then(translated => anchorEl.innerText = translated);
|
||||
}
|
||||
anchorEl.setAttribute('aria-disabled', text ? 'false' : 'true');
|
||||
if (text) {
|
||||
anchorEl.removeAttribute('tabindex');
|
||||
@@ -384,11 +388,11 @@ define('navigator', [
|
||||
anchorEl.setAttribute('tabindex', -1);
|
||||
}
|
||||
}
|
||||
const anchorHeight = anchorEl.getBoundingClientRect().height;
|
||||
|
||||
if (remaining > 0 && (trackHeight - thumbBottom) >= thumbHeight) {
|
||||
const text = await translator.translate(`[[topic:navigator.unread, ${remaining}]]`);
|
||||
if (remaining > 0 && (trackHeight - thumbBottom) >= Math.min(16, anchorHeight)) {
|
||||
anchorEl.href = `${config.relative_path}/topic/${ajaxify.data.slug}/${Math.min(index + 1, ajaxify.data.postcount)}`;
|
||||
toggleAnchor(text);
|
||||
toggleAnchor(`[[topic:navigator.unread, ${remaining}]]`);
|
||||
} else {
|
||||
anchorEl.href = ajaxify.data.url;
|
||||
toggleAnchor('');
|
||||
|
||||
Reference in New Issue
Block a user