Coder Social home page Coder Social logo

Comments (4)

dcoder2099 avatar dcoder2099 commented on May 24, 2024

(note, when I originally logged this issue, I mis-stated that the behavior occurs when item.disabled returns true. That was an error in describing the problem on my part. The issue does exist as is evident by the steps to reproduce I outline.

from jquery-contextmenu.

dcoder2099 avatar dcoder2099 commented on May 24, 2024

Looks like the issue is with line 528 of jquery.contextMenu.js... in the case when opt.items[key].disabled is not a simple property but rather a callback function, that second parameter to the if condition returns true (because it is true that .disabled is there -- it is a function declaration. If I get a chance, I'll work this up in a fork and submit a pull request.

from jquery-contextmenu.

dcoder2099 avatar dcoder2099 commented on May 24, 2024

In case I never get around to that:

diff --git a/jquery.contextMenu.js b/jquery.contextMenu.js
index 759bf68..48d0821 100755
--- a/jquery.contextMenu.js
+++ b/jquery.contextMenu.js
@@ -520,12 +520,13 @@ var // currently active contextMenu trigger
                itemClick: function(e) {
                        var $this = $(this),
                                data = $this.data(),
+                               disabled = $this.hasClass('disabled'),
                                opt = data.contextMenu,
                                root = data.contextMenuRoot,
                                key = data.contextMenuKey;

                        // abort if the key is unknown or disabled
-                       if (!opt.items[key] || opt.items[key].disabled) {
+                       if (!opt.items[key] || disabled) {
                                return;
                        }

from jquery-contextmenu.

rodneyrehm avatar rodneyrehm commented on May 24, 2024

Thanks, missed this at the initial rewrite. Fixed!

from jquery-contextmenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.