File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed
build/media_source/com_categories
components/com_content/tmpl/categories Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 55 "description" : " Joomla CMS" ,
66 "license" : " GPL-2.0-or-later" ,
77 "assets" : [
8+ {
9+ "name" : " com_categories.shared-categories-accordion" ,
10+ "type" : " preset" ,
11+ "dependencies" : [
12+ " com_categories.shared-categories-accordion#style" ,
13+ " com_categories.shared-categories-accordion#script"
14+ ]
15+ },
816 {
917 "name" : " com_categories.shared-categories-accordion.es5" ,
1018 "type" : " script" ,
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ const handleCategoryToggleButtonClick = ({ currentTarget }) => {
3838 ) ,
3939 ) ;
4040
41- const target = button . nextElementSibling ;
41+ const { categoryId } = button . dataset ;
42+ const target = document . getElementById ( `category-${ categoryId } ` ) ;
4243 target . toggleAttribute ( 'hidden' ) ;
4344} ;
4445
Original file line number Diff line number Diff line change 1919/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
2020$ wa = $ this ->document ->getWebAssetManager ();
2121$ wa ->getRegistry ()->addExtensionRegistryFile ('com_categories ' );
22- $ wa ->useStyle ('com_categories.shared-categories-accordion ' );
23- $ wa ->useScript ('com_categories.shared-categories-accordion ' );
22+ $ wa ->usePreset ('com_categories.shared-categories-accordion ' );
2423
2524?>
2625<div class="com-content-categories categories-list">
Original file line number Diff line number Diff line change 3434 <button
3535 type="button"
3636 id="category-btn-<?php echo $ item ->id ; ?> "
37+ data-category-id="<?php echo $ item ->id ; ?> "
3738 class="btn btn-secondary btn-sm"
3839 aria-expanded="false"
3940 aria-label="<?php echo Text::_ ('JGLOBAL_EXPAND_CATEGORIES ' ); ?> "
You can’t perform that action at this time.
0 commit comments