swisnl/jQuery-contextMenu

"TypeError: root is not a function" when click on item named "watch"

hw-dwalter opened this issue · 3 comments

My firefox (17.0) raises an error wehn i click on the item named "watch". The following code demonstrates this behaviour:

$.contextMenu({
    selector: '.context-menu-one', 
    callback: function(key, options) {
        var m = "clicked: " + key;
        window.console && console.log(m) || alert(m); 
    },
    items: {
        "watch": {name: "Edit", icon: "edit"}
    }
});

woha, that's… interesting. I'll look into it. Fiddle

I've fixed this locally. There won't be a new version released until christmas, I think.

In the mean time you can patch this yourself, replace Line 743 with the following:

if ($.isFunction(root.callbacks[key]) && Object.prototype.hasOwnProperty.call(root.callbacks, key)) {

Thank you! That was really quick!