mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2025-02-05 10:48:26 +00:00
Toggle icon Plus/Minus when expanding/collapsing
Ported to com_weblinks from a similar PR in core (https://github.com/joomla/joomla-cms/pull/5469)
This commit is contained in:
parent
8008a986b9
commit
93a093441c
@ -11,6 +11,18 @@ defined('_JEXEC') or die;
|
|||||||
|
|
||||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
|
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
|
||||||
JHtml::_('behavior.caption');
|
JHtml::_('behavior.caption');
|
||||||
|
|
||||||
|
JFactory::getDocument()->addScriptDeclaration("
|
||||||
|
jQuery(function($) {
|
||||||
|
$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
|
||||||
|
var btn = $(btn);
|
||||||
|
btn.on('click', function() {
|
||||||
|
btn.find('span').toggleClass('icon-plus');
|
||||||
|
btn.find('span').toggleClass('icon-minus');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});");
|
||||||
|
|
||||||
echo JLayoutHelper::render('joomla.content.categories_default', $this);
|
echo JLayoutHelper::render('joomla.content.categories_default', $this);
|
||||||
echo $this->loadTemplate('items');
|
echo $this->loadTemplate('items');
|
||||||
?>
|
?>
|
||||||
|
@ -34,7 +34,8 @@ if (count($this->items[$this->parent->id]) > 0 && $this->maxLevelcat != 0) :
|
|||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
|
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
|
||||||
<a href="#category-<?php echo $item->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
|
<a id="category-btn-<?php echo $item->id;?>" href="#category-<?php echo $item->id;?>"
|
||||||
|
data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
</h3>
|
</h3>
|
||||||
<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
|
<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user