Skip to content

Commit

Permalink
Fix to make open menu items active
Browse files Browse the repository at this point in the history
Broken accidentally by previous PR lonnieezell#336
  • Loading branch information
dgvirtual committed May 14, 2023
1 parent 7de4a16 commit 46a6c44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Menus/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function setUrl(string $url)
*/
public function setNamedRoute(string $name)
{
$this->url = url_to($name);
$this->url = route_to($name);

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Menus/MenuItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function testWithNamedRoutes()
$item = new MenuItem();
$item->setNamedRoute('home');

$this->assertSame(site_url('/home-sweet-home'), $item->url());
$this->assertSame('/home-sweet-home', $item->url());
}

public function testPropertyGetter()
Expand Down
2 changes: 1 addition & 1 deletion themes/Admin/Components/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<?php foreach ($collection->items() as $item) : ?>
<?php if ($item->userCanSee()): ?>
<li class="nav-item">
<a class="nav-link <?= url_is($item->url . '*') ? 'active' : '' ?>" href="<?= $item->url ?>">
<a class="nav-link <?= url_is($item->url . '*') ? 'active' : '' ?>" href="<?= site_url($item->url) ?>">
<?php if (! $collection->isCollapsible()) : ?>
<?= $item->icon ?>
<?php endif ?>
Expand Down

0 comments on commit 46a6c44

Please sign in to comment.