Skip to content

Commit

Permalink
Fixing Issue #69 - reposition menu on scrolled documents
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Aug 22, 2012
1 parent 1c85a58 commit 59fdc0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ $.contextMenu is published under the [MIT license](http://www.opensource.org/lic

## Changelog ##

### upcoming ###

* Fixing reposition/close issue on scrolled documents (Issue #69)

### 1.5.22 ###

* Fixing issue with animation and remove on hide (Issue #64)
Expand Down
3 changes: 1 addition & 2 deletions src/jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,11 @@ var // currently active contextMenu trigger
});
setTimeout(function() {
var $window, hideshow;

// test if we need to reposition the menu
if ((root.trigger == 'left' && button == 0) || (root.trigger == 'right' && button == 2)) {
if (document.elementFromPoint) {
root.$layer.hide();
target = document.elementFromPoint(x, y);
target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop());
root.$layer.show();

selectors = [];
Expand Down

0 comments on commit 59fdc0d

Please sign in to comment.