See workitem #18807

--HG--
branch : 1.x
This commit is contained in:
David Cornish@DavidCornish-PC
2012-09-24 18:15:48 +01:00
parent abd894cac8
commit d893ebbcfd

View File

@@ -28,16 +28,16 @@
: null;
IHtmlString sectionHeaderMarkup;
if (firstLevelMenuItem.RouteValues != null || HasText(firstLevelMenuItem.Url)) {
sectionHeaderMarkup = HasText(itemId)
? Html.Link(sectionHeaderText, (string)firstLevelMenuItem.Href, new { @class = itemClassName, id = itemId })
: Html.Link(sectionHeaderText, (string)firstLevelMenuItem.Href, new { @class = itemClassName });
}
else if (firstOfTheSecond != null && firstLevelMenuItem.LinkToFirstChild && (firstOfTheSecond.RouteValues != null || HasText(firstOfTheSecond.Url))) {
if (firstOfTheSecond != null && firstLevelMenuItem.LinkToFirstChild && (firstOfTheSecond.RouteValues != null || HasText(firstOfTheSecond.Url))) {
sectionHeaderMarkup = HasText(itemId)
? Html.Link(sectionHeaderText, (string)firstOfTheSecond.Href, new { @class = itemClassName, id = itemId })
: Html.Link(sectionHeaderText, (string)firstOfTheSecond.Href, new { @class = itemClassName });
}
else if (firstLevelMenuItem.RouteValues != null || HasText(firstLevelMenuItem.Url)) {
sectionHeaderMarkup = HasText(itemId)
? Html.Link(sectionHeaderText, (string)firstLevelMenuItem.Href, new { @class = itemClassName, id = itemId })
: Html.Link(sectionHeaderText, (string)firstLevelMenuItem.Href, new { @class = itemClassName });
}
else {
// if the header isn't linked and there are no children there's no reason for this item in the menu other than to look pretty
if (secondLevelMenuItems.Count() == 0) {