mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: don't use # for previews
This commit is contained in:
@@ -201,10 +201,11 @@ define('forum/topic', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
const href = link.attr('href');
|
const href = link.attr('href');
|
||||||
|
const validHref = href && href !== '#';
|
||||||
const pathname = utils.urlToLocation(href).pathname;
|
const pathname = utils.urlToLocation(href).pathname;
|
||||||
$('#post-tooltip').remove();
|
$('#post-tooltip').remove();
|
||||||
const postMatch = pathname && pathname.match(/\/post\/([\d]+)/);
|
const postMatch = validHref && pathname && pathname.match(/\/post\/([\d]+)/);
|
||||||
const topicMatch = pathname && pathname.match(/\/topic\/([\d]+)/);
|
const topicMatch = validHref && pathname && pathname.match(/\/topic\/([\d]+)/);
|
||||||
if (postMatch) {
|
if (postMatch) {
|
||||||
const pid = postMatch[1];
|
const pid = postMatch[1];
|
||||||
if (parseInt(link.parents('[component="post"]').attr('data-pid'), 10) === parseInt(pid, 10)) {
|
if (parseInt(link.parents('[component="post"]').attr('data-pid'), 10) === parseInt(pid, 10)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user