mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Giving back Classes to the Shapes.
This fixes a limitation where the Classes property on an element shape would be ignored when rendering tags using attributes returned from the TagBuilderExtensions.GetCommonElementAttributes method.
This commit is contained in:
@@ -37,11 +37,16 @@ namespace Orchard.Layouts.Helpers {
|
|||||||
attributes["style"] = Regex.Replace(tokenize(), @"(?:\r\n|[\r\n])", "");
|
attributes["style"] = Regex.Replace(tokenize(), @"(?:\r\n|[\r\n])", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IList<string> classes = shape.Classes;
|
||||||
|
|
||||||
if (!String.IsNullOrWhiteSpace(htmlClass)) {
|
if (!String.IsNullOrWhiteSpace(htmlClass)) {
|
||||||
var tokenize = (Func<string>)shape.TokenizeHtmlClass;
|
var tokenize = (Func<string>)shape.TokenizeHtmlClass;
|
||||||
attributes["class"] = tokenize();
|
var cssClass = tokenize();
|
||||||
|
classes.Add(cssClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
attributes["class"] = String.Join(" ", classes);
|
||||||
|
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user