From 52f1bfb0ec5bf9767005d283a95592225e7e47a7 Mon Sep 17 00:00:00 2001 From: daveherman71 Date: Fri, 12 Nov 2021 16:08:25 +0200 Subject: [PATCH] Update jquery.contextMenu.js --- src/jquery.contextMenu.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/jquery.contextMenu.js b/src/jquery.contextMenu.js index ace46e63..9df87e45 100644 --- a/src/jquery.contextMenu.js +++ b/src/jquery.contextMenu.js @@ -1998,8 +1998,12 @@ name: $node.text(), disabled: !!$node.attr('disabled'), callback: (function () { - return function () { - $node.get(0).click(); + return function (itemKey, opt, ev) { + if ($node.get(0).onclick !== null) { + $node.get(0).click(); + } else { + opt.callback(itemKey, opt, ev); + } }; })() }; @@ -2017,8 +2021,12 @@ disabled: !!$node.attr('disabled'), icon: $node.attr('icon'), callback: (function () { - return function () { - $node.get(0).click(); + return function (itemKey, opt, ev) { + if ($node.get(0).onclick !== null) { + $node.get(0).click(); + } else { + opt.callback(itemKey, opt, ev); + } }; })() };