File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -199,12 +199,17 @@ define([
199
199
*/
200
200
_setActiveMenuForProduct : function ( currentUrl ) {
201
201
var categoryUrlExtension ,
202
+ lastUrlSection ,
202
203
possibleCategoryUrl ,
203
204
//retrieve first category URL to know what extension is used for category URLs
204
205
firstCategoryUrl = this . element . find ( '> li a' ) . attr ( 'href' ) ;
205
206
206
207
if ( firstCategoryUrl ) {
207
- categoryUrlExtension = firstCategoryUrl . substr ( firstCategoryUrl . lastIndexOf ( '.' ) ) ;
208
+ lastUrlSection = firstCategoryUrl . substr ( firstCategoryUrl . lastIndexOf ( '/' ) ) ;
209
+ categoryUrlExtension = ( lastUrlSection . lastIndexOf ( '.' ) !== - 1 )
210
+ ? lastUrlSection . substr ( lastUrlSection . lastIndexOf ( '.' ) ) : '' ;
211
+
212
+ //categoryUrlExtension = lastUrlSection.substr(lastUrlSection.lastIndexOf('.'));
208
213
possibleCategoryUrl = currentUrl . substr ( 0 , currentUrl . lastIndexOf ( '/' ) ) + categoryUrlExtension ;
209
214
this . _setActiveMenuForCategory ( possibleCategoryUrl ) ;
210
215
}
You can’t perform that action at this time.
0 commit comments