Minor refactoring in tag helper services

pull/279/head
yekalkan 7 years ago
parent 86ba6f4082
commit b129ee8cb2

@ -72,7 +72,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel
protected virtual void SetIndicators(TagHelperContext context, TagHelperOutput output, List<CarouselItem> itemList) protected virtual void SetIndicators(TagHelperContext context, TagHelperOutput output, List<CarouselItem> itemList)
{ {
if (!TagHelper.Indicators??false) if (!TagHelper.Indicators ?? false)
{ {
return; return;
} }
@ -83,9 +83,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel
{ {
html.AppendLine( html.AppendLine(
"<li " + "<li " +
"data-target=\"#"+TagHelper.Id+"\"" + "data-target=\"#" + TagHelper.Id + "\"" +
" data-slide-to=\""+i+"\"" + " data-slide-to=\"" + i + "\"" +
(itemList[i].Active?" class=\"active\">":"") + (itemList[i].Active ? " class=\"active\">" : "") +
"</li>"); "</li>");
} }
@ -95,7 +95,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel
protected virtual void SetOneItemAsActive(TagHelperContext context, TagHelperOutput output, List<CarouselItem> itemList) protected virtual void SetOneItemAsActive(TagHelperContext context, TagHelperOutput output, List<CarouselItem> itemList)
{ {
if (!itemList.Any(it=> it.Active) && itemList.Count > 0) if (!itemList.Any(it => it.Active) && itemList.Count > 0)
{ {
itemList.FirstOrDefault().Active = true; itemList.FirstOrDefault().Active = true;
} }
@ -117,7 +117,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Carousel
protected virtual void SetFadeAnimation(TagHelperContext context, TagHelperOutput output) protected virtual void SetFadeAnimation(TagHelperContext context, TagHelperOutput output)
{ {
if (TagHelper.Crossfade??false) if (TagHelper.Crossfade ?? false)
{ {
output.Attributes.AddClass("carousel-fade"); output.Attributes.AddClass("carousel-fade");
} }

@ -11,6 +11,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
output.Attributes.AddClass("dropdown-divider"); output.Attributes.AddClass("dropdown-divider");
output.TagMode = TagMode.StartTagAndEndTag; output.TagMode = TagMode.StartTagAndEndTag;
} }
} }
} }

@ -11,6 +11,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
output.Attributes.AddClass("dropdown-header"); output.Attributes.AddClass("dropdown-header");
output.TagMode = TagMode.StartTagAndEndTag; output.TagMode = TagMode.StartTagAndEndTag;
} }
} }
} }

@ -25,6 +25,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
return; return;
} }
} }
} }
} }

@ -38,6 +38,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Dropdown
return; return;
} }
} }
} }
} }

@ -10,6 +10,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Figure
output.TagName = "figcaption"; output.TagName = "figcaption";
output.Attributes.AddClass("figure-caption"); output.Attributes.AddClass("figure-caption");
} }
} }
} }

@ -9,6 +9,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Figure
{ {
output.Attributes.AddClass("figure-img"); output.Attributes.AddClass("figure-img");
} }
} }
} }

@ -10,6 +10,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Figure
output.TagName = "figure"; output.TagName = "figure";
output.Attributes.AddClass("figure"); output.Attributes.AddClass("figure");
} }
} }
} }

@ -11,6 +11,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid
output.Attributes.AddClass("w-100"); output.Attributes.AddClass("w-100");
output.TagMode = TagMode.StartTagAndEndTag; output.TagMode = TagMode.StartTagAndEndTag;
} }
} }
} }

@ -5,7 +5,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Image
{ {
public class AbpImageTagHelperService : AbpTagHelperService<AbpImageTagHelper> public class AbpImageTagHelperService : AbpTagHelperService<AbpImageTagHelper>
{ {
public override void Process(TagHelperContext context, TagHelperOutput output) public override void Process(TagHelperContext context, TagHelperOutput output)
{ {
output.TagName = "img"; output.TagName = "img";
@ -65,6 +64,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Image
{ {
output.Attributes.Add("alt",TagHelper.Alt); output.Attributes.Add("alt",TagHelper.Alt);
} }
} }
} }

@ -8,6 +8,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Label
{ {
//TODO: fill //TODO: fill
} }
} }
} }

@ -15,6 +15,5 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.ListGroup
output.Attributes.AddClass("list-group-flush"); output.Attributes.AddClass("list-group-flush");
} }
} }
} }
} }
Loading…
Cancel
Save