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:
Sipke Schoorstra
2015-12-25 14:43:43 +01:00
parent 4418bcdc19
commit 49317ec33f

View File

@@ -37,11 +37,16 @@ namespace Orchard.Layouts.Helpers {
attributes["style"] = Regex.Replace(tokenize(), @"(?:\r\n|[\r\n])", "");
}
IList<string> classes = shape.Classes;
if (!String.IsNullOrWhiteSpace(htmlClass)) {
var tokenize = (Func<string>)shape.TokenizeHtmlClass;
attributes["class"] = tokenize();
var cssClass = tokenize();
classes.Add(cssClass);
}
attributes["class"] = String.Join(" ", classes);
return attributes;
}