Merge pull request #18279 from abpframework/icon-patch

Compatible with `Font Awesome`.
pull/18280/head
Enis Necipoglu 1 year ago committed by GitHub
commit 014b9c3853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -289,7 +289,16 @@ public class AbpInputTagHelperService : AbpTagHelperService<AbpInputTagHelper>
label.Attributes.Add("data-bs-html", "true");
}
label.Attributes.Add("title", TagHelper.LabelTooltip);
label.InnerHtml.AppendHtml($" <i class=\"bi {TagHelper.LabelTooltipIcon}\"></i>");
var iconClass = TagHelper.LabelTooltipIcon;
if (iconClass.StartsWith("bi-"))
{
iconClass = "bi " + iconClass;
}
else if (iconClass.StartsWith("fa-"))
{
iconClass = "fa " + iconClass;
}
label.InnerHtml.AppendHtml($" <i class=\"{iconClass}\"></i>");
}
return label.ToHtmlString();
@ -372,7 +381,16 @@ public class AbpInputTagHelperService : AbpTagHelperService<AbpInputTagHelper>
var innerOutput = await labelTagHelper.ProcessAndGetOutputAsync(attributeList, context, "label", TagMode.StartTagAndEndTag);
if (!TagHelper.LabelTooltip.IsNullOrEmpty())
{
innerOutput.Content.AppendHtml($" <i class=\"bi {TagHelper.LabelTooltipIcon}\"></i>");
var iconClass = TagHelper.LabelTooltipIcon;
if (iconClass.StartsWith("bi-"))
{
iconClass = "bi " + iconClass;
}
else if (iconClass.StartsWith("fa-"))
{
iconClass = "fa " + iconClass;
}
innerOutput.Content.AppendHtml($" <i class=\"{iconClass}\"></i>");
}
return innerOutput.Render(_encoder);

@ -547,7 +547,16 @@ public abstract class AbpDatePickerBaseTagHelperService<TTagHelper> : AbpTagHelp
}
label.Attributes.Add("title", TagHelper.LabelTooltip);
label.InnerHtml.AppendHtml($" <i class=\"bi {TagHelper.LabelTooltipIcon}\"></i>");
var iconClass = TagHelper.LabelTooltipIcon;
if (iconClass.StartsWith("bi-"))
{
iconClass = "bi " + iconClass;
}
else if (iconClass.StartsWith("fa-"))
{
iconClass = "fa " + iconClass;
}
label.InnerHtml.AppendHtml($" <i class=\"{iconClass}\"></i>");
}
return label.ToHtmlString();
@ -607,7 +616,16 @@ public abstract class AbpDatePickerBaseTagHelperService<TTagHelper> : AbpTagHelp
await labelTagHelper.ProcessAndGetOutputAsync(attributeList, context, "label", TagMode.StartTagAndEndTag);
if (!TagHelper.LabelTooltip.IsNullOrEmpty())
{
innerOutput.Content.AppendHtml($" <i class=\"bi {TagHelper.LabelTooltipIcon}\"></i>");
var iconClass = TagHelper.LabelTooltipIcon;
if (iconClass.StartsWith("bi-"))
{
iconClass = "bi " + iconClass;
}
else if (iconClass.StartsWith("fa-"))
{
iconClass = "fa " + iconClass;
}
innerOutput.Content.AppendHtml($" <i class=\"{iconClass}\"></i>");
}
return innerOutput.Render(Encoder);

Loading…
Cancel
Save