Refactoring tag helpers

Alerts
pull/279/head
yekalkan 7 years ago
parent 9c5ca48219
commit e95b1a132b

@ -2,12 +2,12 @@
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert
{
[HtmlTargetElement("h1", Attributes = "abp-alert-header", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h2", Attributes = "abp-alert-header", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h3", Attributes = "abp-alert-header", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h4", Attributes = "abp-alert-header", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h5", Attributes = "abp-alert-header", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h6", Attributes = "abp-alert-header", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h1", ParentTag = "abp-alert", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h2", ParentTag = "abp-alert", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h3", ParentTag = "abp-alert", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h4", ParentTag = "abp-alert", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h5", ParentTag = "abp-alert", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("h6", ParentTag = "abp-alert", TagStructure = TagStructure.NormalOrSelfClosing)]
public class AbpAlertHeaderTagHelper : AbpTagHelper<AbpAlertHeaderTagHelper, AbpAlertHeaderTagHelperService>
{

@ -8,7 +8,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.AddClass("alert-heading");
output.Attributes.RemoveAll("abp-alert-header");
}
}
}

@ -8,7 +8,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.AddClass("alert-link");
output.Attributes.RemoveAll("abp-alert-link");
}
}

@ -6,14 +6,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert
{
public class AbpAlertTagHelperService : AbpTagHelperService<AbpAlertTagHelper>
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = "div";
output.TagMode = TagMode.StartTagAndEndTag;
AddClasses(context, output);
AddDismissButtonIfDismissible(context, output);
}

Loading…
Cancel
Save