fix more categories button not moving with parent

fix order issue
isekai-main
Barış Soner Uşaklı 2 years ago
parent 28d1844e7e
commit c0b1ded363

@ -202,7 +202,7 @@ define('admin/manage/categories', [
// this makes sure order is correct when drag & drop is used on pages > 1 // this makes sure order is correct when drag & drop is used on pages > 1
const baseIndex = (ajaxify.data.pagination.currentPage - 1) * ajaxify.data.categoriesPerPage; const baseIndex = (ajaxify.data.pagination.currentPage - 1) * ajaxify.data.categoriesPerPage;
modified[cid] = { modified[cid] = {
order: baseIndex + e.newIndex + 1, order: baseIndex + e.newIndex,
}; };
if (isCategoryUpdate) { if (isCategoryUpdate) {
@ -263,7 +263,11 @@ define('admin/manage/categories', [
categories: categories, categories: categories,
parentCategory: parentCategory, parentCategory: parentCategory,
}, function (html) { }, function (html) {
container.append(html); if (container.find('.category-row').length) {
container.find('.category-row').after(html);
} else {
container.append(html);
}
// Disable expand toggle // Disable expand toggle
if (!categories.length) { if (!categories.length) {

@ -49,11 +49,12 @@
</div> </div>
</div> </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> </li>
{{{ if ../hasMoreSubCategories}}} {{{ end }}}
<li>
<a href="{config.relative_path}/admin/manage/categories?cid={categories.cid}&page={categories.showMorePage}" class="btn btn-default">[[category:x-more-categories, {../subCategoriesLeft}]]</a>
</li>
{{{ end }}}
<!-- END categories -->
</ul> </ul>

Loading…
Cancel
Save