Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

Control.ContextMenu position not assigned correctly

#63

If the viewport_scroll_offsets are not 0 (the page is scrolled down/right), the container positions are not assigned correctly. This only happens with right clicks, left clicks work as expected. I have experienced this problem with Firefox 3 and Safari 4.
Event.pointerY does not return the expected result for a right clicks as described in the API (Prototype 1.6.0.3).

My quick workaround in contextmenu.js:

Object.extend(Control.ContextMenu,{

<...>
positionContainer: function(event){
    var dimensions = Control.ContextMenu.container.getDimensions();
    var top = Event.pointerY(event);
    var left = Event.pointerX(event);
    var bottom = dimensions.height + top;
    var right = dimensions.width + left;
    var viewport_dimensions = document.viewport.getDimensions();
    var viewport_scroll_offsets = document.viewport.getScrollOffsets();
    // add offset if there is a right click
    if(event.isRightClick()) {
  top += viewport_scroll_offsets.top;
  left += viewport_scroll_offsets.left;
}
    if(bottom > viewport_dimensions.height + viewport_scroll_offsets.top) {
        top -= bottom - ((viewport_dimensions.height  + viewport_scroll_offsets.top) - Control.ContextMenu.offset); }
    if(right > viewport_dimensions.width + viewport_scroll_offsets.left) {
        left -= right - ((viewport_dimensions.width + viewport_scroll_offsets.left) - Control.ContextMenu.offset); }
    Control.ContextMenu.container.setStyle({
        top: top + 'px',
        left: left + 'px'
    });
}



});

Reported by Christoph Ambichl · July 28th, 2009 @ 10:34 PM

State: invalid
Milestone: 1.0
Assigned to: Ryan Johnson Ryan Johnson

Activity

  1. Nathan L Smith
    Nathan L Smith
    • Assigned user cleared.
    • State changed from new to unconfirmed

    July 31st, 2009 @ 01:15 PM

  2. Nathan L Smith
    Nathan L Smith
    • Assigned user set to Ryan Johnson
    • State changed from unconfirmed to invalid

    August 13th, 2009 @ 08:20 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.