mirror of https://github.com/abpframework/abp.git
committed by
GitHub
6 changed files with 113 additions and 26 deletions
@ -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"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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> |
||||
|
} |
||||
@ -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; |
||||
|
}); |
||||
|
}); |
||||
Loading…
Reference in new issue