From accabd7cc0245388b3ce69c11b32a412211af158 Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Tue, 25 Jul 2017 14:57:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81=EF=BC=9A?= =?UTF-8?q?=E4=BD=BF=E7=94=A8BootstrapMenu=E6=93=8D=E4=BD=9C=E7=B1=BB?= =?UTF-8?q?=E7=9A=84=E5=86=85=E7=BD=AE=E5=8F=82=E6=95=B0acrtiveUrl?= =?UTF-8?q?=E7=B2=BE=E7=AE=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Models/NavigatorBarModel.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Bootstrap.Admin/Models/NavigatorBarModel.cs b/Bootstrap.Admin/Models/NavigatorBarModel.cs index c9d1e8c7..05e6aaf5 100644 --- a/Bootstrap.Admin/Models/NavigatorBarModel.cs +++ b/Bootstrap.Admin/Models/NavigatorBarModel.cs @@ -1,8 +1,6 @@ using Bootstrap.DataAccess; using Bootstrap.Security; -using System; using System.Collections.Generic; -using System.Linq; namespace Bootstrap.Admin.Models { @@ -10,21 +8,10 @@ namespace Bootstrap.Admin.Models { public NavigatorBarModel(string url) { - Navigations = BootstrapMenu.RetrieveSystemMenus(UserName); + Navigations = BootstrapMenu.RetrieveSystemMenus(UserName, url); Applications = DictHelper.RetrieveApps(); - ActiveMenu(null, Navigations.ToList(), url); HomeUrl = "~/Admin/Index"; } - - private void ActiveMenu(BootstrapMenu parent, List menus, string url) - { - menus.ForEach(m => - { - m.Active = m.Url.Equals(url, StringComparison.OrdinalIgnoreCase) ? "active" : ""; - ActiveMenu(m, m.Menus.ToList(), url); - if (parent != null && m.Active != "") parent.Active = m.Active; - }); - } /// /// ///