From 50a98bf7d0fae2b13f2bb89f352ae6497f32bfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=BE=BE?= Date: Thu, 29 Jan 2015 21:41:16 +0800 Subject: [PATCH] Update bootstrap-contextmenu.js --- bootstrap-contextmenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-contextmenu.js b/bootstrap-contextmenu.js index dc1e38bc..d985c090 100644 --- a/bootstrap-contextmenu.js +++ b/bootstrap-contextmenu.js @@ -159,7 +159,7 @@ // If context-menu's parent is positioned using absolute or relative positioning, // the calculated mouse position will be incorrect. // Adjust the position of the menu by its offset parent position. - parentOffset = $menu.offsetParent().offset(); + parentOffset = $menu.offsetParent().offset() || { left: 0, top: 0}; X.left = X.left - parentOffset.left; Y.top = Y.top - parentOffset.top;