Improve isActive logic

This commit is contained in:
Samuel Štancl 2020-04-24 18:06:47 +02:00 committed by GitHub
parent ff8b594cbd
commit 791e8433f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ return [
// helpers
'isActive' => function ($page, $path) {
return ends_with(trimPath($page->getPath()), trimPath($path));
return ends_with(trimPath($page->getPath()), trimPath($page->version() . '/' . $path));
},
'isActiveParent' => function ($page, $menuItem) {
if (is_object($menuItem) && $menuItem->children) {