mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: closes #12115 , toggle hasmore as well
This commit is contained in:
@@ -46,6 +46,10 @@ define('admin/manage/categories', [
|
|||||||
const el = $(this);
|
const el = $(this);
|
||||||
el.find('i').toggleClass('fa-chevron-down').toggleClass('fa-chevron-right');
|
el.find('i').toggleClass('fa-chevron-down').toggleClass('fa-chevron-right');
|
||||||
el.closest('[data-cid]').find('> ul[data-cid]').toggleClass('hidden');
|
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 () {
|
$('.categories').on('click', '.set-order', function () {
|
||||||
|
|||||||
@@ -55,8 +55,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="list-unstyled has-more-categories {{{ if !../hasMoreSubCategories}}}hidden{{{ end }}}">
|
<ul class="list-unstyled has-more-categories mt-2 {{{ if !./hasMoreSubCategories}}}hidden{{{ end }}}" data-hasmore="{{{ if ./hasMoreSubCategories}}}1{{{ else }}}0{{{ end }}}">
|
||||||
<li>
|
<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>
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user