From 03299736dc79d6048a01ba5fd9ce800baa5e94a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 1 Jan 2019 18:04:03 -0500 Subject: [PATCH] fix: #7179 don't consider pinned topics in widget areas --- public/src/client/category/tools.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/src/client/category/tools.js b/public/src/client/category/tools.js index 6dca6671a3..ae0358d966 100644 --- a/public/src/client/category/tools.js +++ b/public/src/client/category/tools.js @@ -259,12 +259,15 @@ define('forum/category/tools', [ return; } app.loadJQueryUI(function () { - $('[component="category"]').sortable({ + var topicListEl = $('[component="category"]').filter(function (i, e) { + return !$(e).parents('[widget-area]').length; + }); + topicListEl.sortable({ items: '[component="category/topic"].pinned', update: function () { var data = []; - var pinnedTopics = $('[component="category/topic"].pinned'); + var pinnedTopics = topicListEl.find('[component="category/topic"].pinned'); pinnedTopics.each(function (index, element) { data.push({ tid: $(element).attr('data-tid'), order: pinnedTopics.length - index - 1 }); });