more conditions have to be verified before unfolding the 'more actions' menu content directly into the box stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 24 Nov 2009 17:27:10 +0100
branchstable
changeset 3916 6e7af0e8e524
parent 3915 2d23304289a6
child 3917 0f912c1cde28
more conditions have to be verified before unfolding the 'more actions' menu content directly into the box
web/views/boxes.py
--- a/web/views/boxes.py	Tue Nov 24 13:59:46 2009 +0100
+++ b/web/views/boxes.py	Tue Nov 24 17:27:10 2009 +0100
@@ -69,7 +69,8 @@
                 else:
                     menu = defaultmenu
                 action.fill_menu(self, menu)
-        if box.is_empty() and not other_menu.is_empty():
+        # if we've nothing but actions in the other_menu, add them directly into the box
+        if box.is_empty() and len(self._menus_by_id) == 1 and not other_menu.is_empty():
             box.items = other_menu.items
             other_menu.items = []
         else: # ensure 'more actions' menu appears last