mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 09:31:17 +01:00
fix: #9790, get baseIndex on update for infinitescroll
This commit is contained in:
@@ -284,11 +284,11 @@ define('forum/category/tools', [
|
|||||||
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;
|
||||||
});
|
});
|
||||||
var baseIndex = parseInt(topicListEl.find('[component="category/topic"].pinned').first().attr('data-index'), 10);
|
|
||||||
topicListEl.sortable({
|
topicListEl.sortable({
|
||||||
handle: '[component="topic/pinned"]',
|
handle: '[component="topic/pinned"]',
|
||||||
items: '[component="category/topic"].pinned',
|
items: '[component="category/topic"].pinned',
|
||||||
update: function (ev, ui) {
|
update: function (ev, ui) {
|
||||||
|
var baseIndex = parseInt(topicListEl.find('[component="category/topic"].pinned').first().attr('data-index'), 10);
|
||||||
socket.emit('topics.orderPinnedTopics', {
|
socket.emit('topics.orderPinnedTopics', {
|
||||||
tid: ui.item.attr('data-tid'),
|
tid: ui.item.attr('data-tid'),
|
||||||
order: baseIndex + ui.item.index() - 1,
|
order: baseIndex + ui.item.index() - 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user