Fix categories accordion

This commit is contained in:
Tuan Pham Ngoc 2021-08-14 15:32:36 +07:00
parent 515471ca54
commit c3bf647c03
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ Text::script('JGLOBAL_COLLAPSE_CATEGORIES');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_categories');
$wa->useScript('com_categories.shared-categories-accordion');
$wa->usePreset('com_categories.shared-categories-accordion');
?>
<div class="com-weblinks-categories categories-list">

View File

@ -32,9 +32,9 @@ if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
<button
type="button"
id="category-btn-<?php echo $item->id; ?>"
data-bs-target="#category-<?php echo $item->id; ?>"
data-bs-toggle="collapse"
data-category-id="<?php echo $item->id; ?>"
class="btn btn-secondary btn-sm float-end"
aria-expanded="false"
aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
>
<span class="icon-plus" aria-hidden="true"></span>
@ -50,7 +50,7 @@ if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
<?php endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<div class="collapse fade" id="category-<?php echo $item->id; ?>">
<div class="com-weblinks-categories__children" id="category-<?php echo $item->id; ?>" hidden>
<?php
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;