Defect #960

Right click menu can be rendered off-screen

Added by Mike Duchene over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:2008-03-30
Priority:LowDue date:
Assignee:-% Done:

0%

Category:UI
Target version:0.7
Resolution:Fixed Affected version:

Description

The right click menu is always rendered below and to the right of the mouse cursor. Thus it is possible to cause this menu to be rendered "off the screen". For example, if you go into issues and right click on an issue towards the bottom of the browser window, the entire menu will be rendered below the visible browser area.

If the cursor is towards the bottom of the browser window then the menu should be rendered above (instead of below).
If the cursor is towards the right of the browser window then the menu should be rendered to the left (instead of to the right).
In the degenerate case when the cursor is close to all sides of the browser window (i.e. the browser window is resized to be very small) then the menu should be rendered in the default manner.

Obviously this is low priority.

As I am not familiar with the source layout, if someone wants to point me to which source file generate the menu I would be willing to take a crack at doing this. This would be a good example to learn the code and help contribute.

context_menu_patch.diff Magnifier - the patch (2.47 KB) Mike Duchene, 2008-04-03 03:42

context_menu.js - the file (incase the patch does not work) (6.33 KB) Mike Duchene, 2008-04-03 03:42


Related issues

Related to Redmine - Defect #981: Incompatbility with prototype.js version 1.6.0.2 Closed 2008-04-03
Duplicates Redmine - Defect #618: right click on an issue line near the bottom of the brows... Closed 2008-02-08

Associated revisions

Revision 1323
Added by Jean-Philippe Lang over 9 years ago

Display the context menu above and/or to the left of the click if needed (patch by Mike Duchene, closes #960).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

The js that displays the menu is located here public/javascripts/context_menu.js (see showMenu on line 95).
Good luck :-)

#2 Updated by Mike Duchene over 9 years ago

see attached patch for suggested fix.
patched against posted 0.7.0_RC1.
Fully tested with FF 2.0.0.12.
Mostly tested with IE6 and IE7.
Need to test with IE5 (if this is even necessary).
Should work with all other browsers.

#3 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Target version set to 0.7
  • Resolution set to Fixed

Thanks for this patch Mike. It's committed in r1323.
I made a slight change so that the submenus are also displayed above or to the left.
Tested with FF2, IE6/7, Safari3, Opera8 (submenus will always be displayed on the right with IE6). Personnaly, I do not (and won't) test anything with IE5.

Thanks!

Also available in: Atom PDF