From 12cd09e347f2792bfb65c884360c064849def0b0 Mon Sep 17 00:00:00 2001 From: yekalkan Date: Tue, 22 May 2018 08:43:38 +0300 Subject: [PATCH] Tag helpers small refactoring --- .../TagHelpers/Nav/AbpNavItemTagHelperService.cs | 1 - .../TagHelpers/Nav/AbpNavLinkTagHelperService.cs | 9 +-------- .../TagHelpers/Nav/AbpNavbarNavTagHelperService.cs | 1 - .../Pages/Components/Navs.cshtml | 14 +++++--------- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavItemTagHelperService.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavItemTagHelperService.cs index 1c2a0d383c..b4e8575ac8 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavItemTagHelperService.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavItemTagHelperService.cs @@ -14,7 +14,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Nav SetActiveClass(context, output); } - protected virtual void SetDropdownClass(TagHelperContext context, TagHelperOutput output) { if (TagHelper.Dropdown ?? false) diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavLinkTagHelperService.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavLinkTagHelperService.cs index ea74c0fe5a..48f4867662 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavLinkTagHelperService.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavLinkTagHelperService.cs @@ -8,14 +8,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Nav { public class AbpNavLinkTagHelperService : AbpTagHelperService { - private readonly HtmlEncoder _encoder; - - public AbpNavLinkTagHelperService(HtmlEncoder encoder) - { - _encoder = encoder; - } - - public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) + public override void Process(TagHelperContext context, TagHelperOutput output) { output.TagName = "a"; output.TagMode = TagMode.StartTagAndEndTag; diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavbarNavTagHelperService.cs b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavbarNavTagHelperService.cs index 85bd1fdb2a..7f09c2ec1c 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavbarNavTagHelperService.cs +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Nav/AbpNavbarNavTagHelperService.cs @@ -9,7 +9,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Nav { output.TagName = "ul"; output.Attributes.AddClass("navbar-nav"); - output.Attributes.AddClass("mr-auto"); } } } \ No newline at end of file diff --git a/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml b/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml index ab9f87b2a6..1edd06dd09 100644 --- a/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml +++ b/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml @@ -80,13 +80,11 @@ Disabled + + Sample Text + - - - Sample Text - - @@ -118,13 +116,11 @@ <abp-nav-item> <a abp-nav-link disabled="true" href="#">Disabled</a> </abp-nav-item> - </abp-navbar-nav> - </abp-navbar-toggle> - + </abp-navbar-nav> <span abp-navbar-text> Sample Text </span> - + </abp-navbar-toggle> </abp-nav-bar>