File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -616,7 +616,7 @@ define([
616
616
for ( let l = 0 ; l < 10 ; l ++ ) {
617
617
hierarchical_levels . push ( 'categories.level' + l . toString ( ) ) ;
618
618
}
619
-
619
+
620
620
const hierarchicalMenuParams = {
621
621
container : facet . wrapper . appendChild (
622
622
algoliaCommon . createISWidgetContainer ( facet . attribute )
@@ -626,7 +626,6 @@ define([
626
626
templates : templates ,
627
627
showParentLevel : true ,
628
628
limit : algoliaConfig . maxValuesPerFacet ,
629
- rootPath : algoliaConfig . request . path ,
630
629
sortBy : [ 'name:asc' ] ,
631
630
transformItems ( items ) {
632
631
return algoliaConfig . isCategoryPage
@@ -642,10 +641,14 @@ define([
642
641
: items ;
643
642
} ,
644
643
} ;
645
-
644
+
645
+ if ( algoliaConfig . isCategoryPage ) {
646
+ hierarchicalMenuParams . rootPath = algoliaConfig . request . path ;
647
+ }
648
+
646
649
hierarchicalMenuParams . templates . item =
647
650
'' +
648
- '<a class="{{cssClasses.link}} {{#isRefined}}{{cssClasses.link}}--selected{{/isRefined}}" href="{{categoryUrl}}">{{label}}' +
651
+ '<a class="{{cssClasses.link}} {{#isRefined}}{{cssClasses.link}}--selected{{/isRefined}}" href="{{categoryUrl}}"><span class="ais-HierarchicalMenu-label"> {{label}}</span> ' +
649
652
' ' +
650
653
'<span class="{{cssClasses.count}}">{{#helpers.formatNumber}}{{count}}{{/helpers.formatNumber}}</span>' +
651
654
'</a>' ;
@@ -660,7 +663,7 @@ define([
660
663
return ! items . length ;
661
664
} ,
662
665
} ;
663
-
666
+
664
667
return [ 'hierarchicalMenu' , hierarchicalMenuParams ] ;
665
668
} ,
666
669
} ;
You can’t perform that action at this time.
0 commit comments