forked from abpframework/abp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request abpframework#839 from abpframework/Basic-theme-mul…
…ti-level-menu Basic theme multi level menu
- Loading branch information
Showing
6 changed files
with
113 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
.../src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Bundling/BasicThemeGlobalScriptContributor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; | ||
|
||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling | ||
{ | ||
public class BasicThemeGlobalScriptContributor : BundleContributor | ||
{ | ||
public override void ConfigureBundle(BundleConfigurationContext context) | ||
{ | ||
context.Files.Add("/themes/basic/layout.js"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@using Volo.Abp.UI.Navigation | ||
@model ApplicationMenuItem | ||
@{ | ||
var elementId = string.IsNullOrEmpty(Model.ElementId) ? string.Empty : $"id=\"{Model.ElementId}\""; | ||
var cssClass = string.IsNullOrEmpty(Model.CssClass) ? string.Empty : Model.CssClass; | ||
var disabled = Model.IsDisabled ? "disabled" : string.Empty; | ||
} | ||
@if (Model.IsLeaf) | ||
{ | ||
@if (Model.Url != null) | ||
{ | ||
<a class="dropdown-item @cssClass @disabled" href="@(Model.Url ?? "#")" @Html.Raw(elementId)> | ||
@Model.DisplayName | ||
</a> | ||
} | ||
} | ||
else | ||
{ | ||
<div class="dropdown-submenu"> | ||
<a role="button" class="btn dropdown-toggle" data-toggle="dropdown" | ||
aria-haspopup="true" aria-expanded="false"> | ||
<span class="lp-icon"> | ||
<i class="@(Model.Icon ?? "")"></i> | ||
</span> | ||
<span class="lp-text"> | ||
@Model.DisplayName | ||
</span> | ||
</a> | ||
<div class="dropdown-menu"> | ||
@foreach (var childMenuItem in Model.Items) | ||
{ | ||
@await Html.PartialAsync("~/Themes/Basic/Components/Menu/_MenuItem.cshtml", childMenuItem) | ||
} | ||
</div> | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/wwwroot/themes/basic/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
$(function () { | ||
$('.dropdown-menu a.dropdown-toggle').on('click', function (e) { | ||
if (!$(this).next().hasClass('show')) { | ||
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); | ||
} | ||
|
||
var $subMenu = $(this).next(".dropdown-menu"); | ||
$subMenu.toggleClass('show'); | ||
|
||
$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) { | ||
$('.dropdown-submenu .show').removeClass("show"); | ||
}); | ||
|
||
return false; | ||
}); | ||
}); |