fix: closes #12115 , toggle hasmore as well

This commit is contained in:
Barış Soner Uşaklı
2023-10-24 10:52:33 -04:00
parent 7134265b5d
commit 728d63f953
2 changed files with 9 additions and 2 deletions

View File

@@ -46,6 +46,10 @@ define('admin/manage/categories', [
const el = $(this);
el.find('i').toggleClass('fa-chevron-down').toggleClass('fa-chevron-right');
el.closest('[data-cid]').find('> ul[data-cid]').toggleClass('hidden');
const hasMoreEl = el.closest('[data-cid]').find('> ul.has-more-categories');
if (parseInt(hasMoreEl.attr('data-hasmore'), 10) === 1) {
hasMoreEl.toggleClass('hidden');
}
});
$('.categories').on('click', '.set-order', function () {

View File

@@ -55,8 +55,11 @@
</div>
</div>
<ul class="list-unstyled has-more-categories {{{ if !../hasMoreSubCategories}}}hidden{{{ end }}}">
<li>
<ul class="list-unstyled has-more-categories mt-2 {{{ if !./hasMoreSubCategories}}}hidden{{{ end }}}" data-hasmore="{{{ if ./hasMoreSubCategories}}}1{{{ else }}}0{{{ end }}}">
<li class="d-flex gap-2">
<div class="invisible toggle text-center text-sm">
<i class="fa fa-chevron-down"></i>
</div>
<a href="{config.relative_path}/admin/manage/categories?cid={categories.cid}&page={categories.showMorePage}" class="btn btn-sm btn-light">[[category:x-more-categories, {../subCategoriesLeft}]]</a>
</li>
</ul>