Skip to content

Commit

Permalink
Fix global menu item, don't use view name in selected condition becau…
Browse files Browse the repository at this point in the history
…se global menu items are selected on every view
  • Loading branch information
projekt01 committed Dec 23, 2007
1 parent bd1aaae commit 212b3fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/z3c/menu/ready2go/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ def __repr__(self):
class GlobalMenuItem(MenuItem):
"""Global menu item."""

@property
def selected(self):
if self.viewInterface.providedBy(self.__parent__) and \
self.contextInterface.providedBy(self.__parent__.context):
return True
return False

def getURLContext(self):
return hooks.getSite()

Expand Down

0 comments on commit 212b3fc

Please sign in to comment.