mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-10 06:30:47 +01:00
fix more categories button not moving with parent
fix order issue
This commit is contained in:
@@ -202,7 +202,7 @@ define('admin/manage/categories', [
|
||||
// this makes sure order is correct when drag & drop is used on pages > 1
|
||||
const baseIndex = (ajaxify.data.pagination.currentPage - 1) * ajaxify.data.categoriesPerPage;
|
||||
modified[cid] = {
|
||||
order: baseIndex + e.newIndex + 1,
|
||||
order: baseIndex + e.newIndex,
|
||||
};
|
||||
|
||||
if (isCategoryUpdate) {
|
||||
@@ -263,7 +263,11 @@ define('admin/manage/categories', [
|
||||
categories: categories,
|
||||
parentCategory: parentCategory,
|
||||
}, function (html) {
|
||||
container.append(html);
|
||||
if (container.find('.category-row').length) {
|
||||
container.find('.category-row').after(html);
|
||||
} else {
|
||||
container.append(html);
|
||||
}
|
||||
|
||||
// Disable expand toggle
|
||||
if (!categories.length) {
|
||||
|
||||
@@ -44,11 +44,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="list-unstyled has-more-categories {{{ if !../hasMoreSubCategories}}}hidden{{{ end }}}">
|
||||
<li>
|
||||
<a href="{config.relative_path}/admin/manage/categories?cid={categories.cid}&page={categories.showMorePage}" class="btn btn-outline-secondary">[[category:x-more-categories, {../subCategoriesLeft}]]</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{{{ if ../hasMoreSubCategories}}}
|
||||
<li>
|
||||
<a href="{config.relative_path}/admin/manage/categories?cid={categories.cid}&page={categories.showMorePage}" class="btn btn-outline-secondary">[[category:x-more-categories, {../subCategoriesLeft}]]</a>
|
||||
</li>
|
||||
{{{ end }}}
|
||||
{{{ end }}}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user