|
|
|
@ -1,13 +1,14 @@ |
|
|
|
using System; |
|
|
|
using Localization.Resources.AbpUi; |
|
|
|
using Localization.Resources.AbpUi; |
|
|
|
using Microsoft.AspNetCore.Razor.TagHelpers; |
|
|
|
using Microsoft.Extensions.Localization; |
|
|
|
using System; |
|
|
|
|
|
|
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button |
|
|
|
{ |
|
|
|
public class AbpButtonTagHelperService : AbpButtonTagHelperServiceBase<AbpButtonTagHelper> |
|
|
|
{ |
|
|
|
protected const string DataBusyTextAttributeName = "data-busy-text"; |
|
|
|
protected const string DataBusyTextIsHtmlAttributeName = "data-busy-text-is-html"; |
|
|
|
|
|
|
|
protected IStringLocalizer<AbpUiResource> L { get; } |
|
|
|
|
|
|
|
@ -22,6 +23,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button |
|
|
|
output.TagName = "button"; |
|
|
|
AddType(context, output); |
|
|
|
AddBusyText(context, output); |
|
|
|
AddBusyTextIsHtml(context, output); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void AddType(TagHelperContext context, TagHelperOutput output) |
|
|
|
@ -44,5 +46,15 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button |
|
|
|
|
|
|
|
output.Attributes.SetAttribute(DataBusyTextAttributeName, busyText); |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void AddBusyTextIsHtml(TagHelperContext context, TagHelperOutput output) |
|
|
|
{ |
|
|
|
if (!TagHelper.BusyTextIsHtml) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
output.Attributes.SetAttribute(DataBusyTextIsHtmlAttributeName, TagHelper.BusyTextIsHtml.ToString().ToLower()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |