Fixing issue when two menu items have the same name.

This commit is contained in:
spf13
2014-05-14 18:01:13 -04:00
parent 4f75ec985d
commit a4a1e39a51
5 changed files with 43 additions and 29 deletions

View File

@@ -405,7 +405,7 @@ func (page *Page) HasMenuCurrent(menu string, me *MenuEntry) bool {
if m, ok := menus[menu]; ok {
if me.HasChildren() {
for _, child := range me.Children {
if child.Name == m.Name {
if child.IsEqual(m) {
return true
}
}
@@ -416,11 +416,11 @@ func (page *Page) HasMenuCurrent(menu string, me *MenuEntry) bool {
}
func (page *Page) IsMenuCurrent(menu string, name string) bool {
func (page *Page) IsMenuCurrent(menu string, inme *MenuEntry) bool {
menus := page.Menus()
if me, ok := menus[menu]; ok {
return me.Name == name
return me.IsEqual(inme)
}
return false