From 6a55c02702dadd60f26545b7b4ce779f9e666d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 11 Sep 2021 18:07:01 -0400 Subject: [PATCH] fix: #9790, get baseIndex on update for infinitescroll --- public/src/client/category/tools.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/category/tools.js b/public/src/client/category/tools.js index 5087a0fe2e..a46624536c 100644 --- a/public/src/client/category/tools.js +++ b/public/src/client/category/tools.js @@ -284,11 +284,11 @@ define('forum/category/tools', [ var topicListEl = $('[component="category"]').filter(function (i, e) { return !$(e).parents('[widget-area],[data-widget-area]').length; }); - var baseIndex = parseInt(topicListEl.find('[component="category/topic"].pinned').first().attr('data-index'), 10); topicListEl.sortable({ handle: '[component="topic/pinned"]', items: '[component="category/topic"].pinned', update: function (ev, ui) { + var baseIndex = parseInt(topicListEl.find('[component="category/topic"].pinned').first().attr('data-index'), 10); socket.emit('topics.orderPinnedTopics', { tid: ui.item.attr('data-tid'), order: baseIndex + ui.item.index() - 1,