From 59fdc0d716feba569e4b3bd906b915a20b3f2499 Mon Sep 17 00:00:00 2001 From: Rodney Rehm Date: Wed, 22 Aug 2012 09:50:56 +0200 Subject: [PATCH] Fixing Issue #69 - reposition menu on scrolled documents --- README.md | 4 ++++ src/jquery.contextMenu.js | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5471c487..26d59531 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index 2b4da541..35289e2c 100755 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -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 = [];