mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: sortable topics even if only 1 pinned topic
This commit is contained in:
@@ -254,9 +254,15 @@ define('forum/category/tools', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handlePinnedTopicSort() {
|
function handlePinnedTopicSort() {
|
||||||
if (!ajaxify.data.privileges.isAdminOrMod) {
|
var numPinned = ajaxify.data.topics.reduce(function (memo, topic) {
|
||||||
|
memo = topic.pinned ? memo += 1 : memo;
|
||||||
|
return memo;
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
if (!ajaxify.data.privileges.isAdminOrMod || numPinned < 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
app.loadJQueryUI(function () {
|
app.loadJQueryUI(function () {
|
||||||
var topicListEl = $('[component="category"]').filter(function (i, e) {
|
var topicListEl = $('[component="category"]').filter(function (i, e) {
|
||||||
return !$(e).parents('[widget-area],[data-widget-area]').length;
|
return !$(e).parents('[widget-area],[data-widget-area]').length;
|
||||||
|
|||||||
Reference in New Issue
Block a user