30
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-06-16 21:12:22 +00:00

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 */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager(); $wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_categories'); $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"> <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 <button
type="button" type="button"
id="category-btn-<?php echo $item->id; ?>" id="category-btn-<?php echo $item->id; ?>"
data-bs-target="#category-<?php echo $item->id; ?>" data-category-id="<?php echo $item->id; ?>"
data-bs-toggle="collapse"
class="btn btn-secondary btn-sm float-end" class="btn btn-secondary btn-sm float-end"
aria-expanded="false"
aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>" aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
> >
<span class="icon-plus" aria-hidden="true"></span> <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 endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?> <?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 <?php
$this->items[$item->id] = $item->getChildren(); $this->items[$item->id] = $item->getChildren();
$this->parent = $item; $this->parent = $item;