mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
[Fixes #6812] Add shape attributes to "CreateElementTagBuilder"
This commit is contained in:
committed by
Sébastien Ros
parent
94ddb257e1
commit
01fa02bd90
@@ -14,9 +14,10 @@ namespace Orchard.Layouts.Helpers {
|
|||||||
public static OrchardTagBuilder CreateElementTagBuilder(dynamic shape, string tag = "div") {
|
public static OrchardTagBuilder CreateElementTagBuilder(dynamic shape, string tag = "div") {
|
||||||
return AddCommonElementAttributes(new OrchardTagBuilder(tag), shape);
|
return AddCommonElementAttributes(new OrchardTagBuilder(tag), shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OrchardTagBuilder AddCommonElementAttributes(this OrchardTagBuilder tagBuilder, dynamic shape) {
|
public static OrchardTagBuilder AddCommonElementAttributes(this OrchardTagBuilder tagBuilder, dynamic shape) {
|
||||||
var attributes = GetCommonElementAttributes(shape);
|
var attributes = GetCommonElementAttributes(shape);
|
||||||
|
tagBuilder.MergeAttributes(shape.Attributes);
|
||||||
tagBuilder.MergeAttributes(attributes);
|
tagBuilder.MergeAttributes(attributes);
|
||||||
return tagBuilder;
|
return tagBuilder;
|
||||||
}
|
}
|
||||||
@@ -46,7 +47,7 @@ namespace Orchard.Layouts.Helpers {
|
|||||||
classes.Add(cssClass);
|
classes.Add(cssClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(classes.Any())
|
if (classes.Any())
|
||||||
attributes["class"] = String.Join(" ", classes);
|
attributes["class"] = String.Join(" ", classes);
|
||||||
|
|
||||||
return attributes;
|
return attributes;
|
||||||
|
|||||||
Reference in New Issue
Block a user