Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 395969

Summary: improved menu positioning
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2012-12-06 13:40:51 EST
menu positioning should be improved similar to the tooltip positioning.
If a menu doesn't fit in its prescribed place, it should be shifted in another direction where makes sense.  (up instead of down, left instead of right). 

I did this for the user menu in bug 394794 but this doesn't handle the case where a menu is clipped by a parent div.  (For example, the switch outline menu).  To fix that kind of problem, we need to make the dropdowns children of the document and then rely on absolute positioning every time it opens.

For submenus, this means pop left if popping right doesn't fit.  I checked dijit behavior here, and that's what it does (the right facing arrows still point right but the menu will pop left if it doesn't fit).

If a menu can't fit vertically below the trigger, we should try above.

If it fits neither way, then we should force the best fit possible as we do with tooltips.
Comment 1 Susan McCourt CLA 2013-01-15 16:53:38 EST
I went with a less general (but working for our issues) solution.  Commit is
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=783d3271e9604a328ff57589d6ff0245ccb8b696

Before I checked for the right edge of the document and adjusted the menu left if it didn't fit.  Now I check for the right edge of any parent that has a hard right edge or absolute positioning.  This fixes the outliner case and continues to fix the User menu case.

This will not adjust up or down, or flip submenus, but I'd like to see a problem first.  We could probably flip submenus with a style that the client would use.  (That's what twitter bootstrap's dropdown does).