mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: prevent category filter to go to selected cid
if there is an href on the clicked element, like all categories item
This commit is contained in:
@@ -61,11 +61,12 @@ define('categoryFilter', ['categorySearch', 'api', 'hooks'], function (categoryS
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
el.on('click', '[component="category/list"] [data-cid]', function () {
|
el.on('click', '[component="category/list"] [data-cid]', function (ev) {
|
||||||
const listEl = el.find('[component="category/list"]');
|
const listEl = el.find('[component="category/list"]');
|
||||||
const categoryEl = $(this);
|
const categoryEl = $(this);
|
||||||
const link = categoryEl.find('a').attr('href');
|
const link = categoryEl.find('a').attr('href');
|
||||||
if (link && link !== '#' && link.length) {
|
if (link && link !== '#' && link.length) {
|
||||||
|
ev.stopPropagation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cid = categoryEl.attr('data-cid');
|
const cid = categoryEl.attr('data-cid');
|
||||||
|
|||||||
Reference in New Issue
Block a user