Skip to content

Node.js based forum software built for the modern web

fix: hide current category from move topic selector (#14228)

palmoni5bbdf05d647c6
diff --git a/public/src/client/topic/move.js b/public/src/client/topic/move.js
index 22c693bb29..56d0b6f687 100644
--- a/public/src/client/topic/move.js
+++ b/public/src/client/topic/move.js
@@ -35,6 +35,7 @@ define('forum/topic/move', [
onSelect: onCategorySelected,
privilege: 'moderate',
localOnly: true,
+ disabledCids: Move.currentCid ? [Move.currentCid] : [],
});
const dropdown = new bootstrap.Dropdown(dropdownEl.find('button'));
diff --git a/public/src/modules/categorySearch.js b/public/src/modules/categorySearch.js
index 8542131b37..9012498aed 100644
--- a/public/src/modules/categorySearch.js
+++ b/public/src/modules/categorySearch.js
@@ -88,8 +88,12 @@ define('categorySearch', ['alerts', 'bootstrap', 'api'], function (alerts, boots
function renderList(categories) {
const selectedCids = options.selectedCids.map(String);
+ const disabledCids = (options.disabledCids || []).map(String);
categories.forEach(function (c) {
c.selected = selectedCids.includes(String(c.cid));
+ if (disabledCids.includes(String(c.cid))) {
+ c.disabledClass = true;
+ }
});
app.parseAndTranslate(options.template, {
categoryItems: categories.slice(0, 200),