Compare commits

..

2 Commits

Author SHA1 Message Date
Barış Soner Uşaklı
b46dcd9243 fix: use component instead of class name 2021-12-23 11:07:57 -05:00
Barış Soner Uşaklı
1a375000a7 refactor: only pass qs 2021-12-16 13:47:12 -05:00
2 changed files with 8 additions and 6 deletions

View File

@@ -285,7 +285,7 @@ define('forum/topic/threadTools', [
threadEl.find('[component="post"][data-uid="' + app.user.uid + '"].deleted [component="post/tools"]').toggleClass('hidden', isLocked);
$('.topic-header [component="topic/locked"]').toggleClass('hidden', !data.isLocked);
$('[component="topic/labels"] [component="topic/locked"]').toggleClass('hidden', !data.isLocked);
$('[component="post/tools"] .dropdown-menu').html('');
ajaxify.data.locked = data.isLocked;
@@ -334,7 +334,7 @@ define('forum/topic/threadTools', [
components.get('topic/pin').toggleClass('hidden', data.pinned).parent().attr('hidden', data.pinned ? '' : null);
components.get('topic/unpin').toggleClass('hidden', !data.pinned).parent().attr('hidden', !data.pinned ? '' : null);
const icon = $('.topic-header [component="topic/pinned"]');
const icon = $('[component="topic/labels"] [component="topic/pinned"]');
icon.toggleClass('hidden', !data.pinned);
if (data.pinned) {
icon.translateAttr('title', (

View File

@@ -50,10 +50,12 @@ module.exports = function (SocketCategories) {
};
async function findMatchedCids(uid, data) {
const params = { ...data, uid, paginate: false };
params.query = data.search;
params.qs = data.query;
const result = await categories.search(params);
const result = await categories.search({
uid: uid,
query: data.search,
qs: data.query,
paginate: false,
});
let matchedCids = result.categories.map(c => c.cid);
// no need to filter if all 3 states are used