Skip to content

jQuery second contextMenu don't show properly #238

@germanmartin

Description

@germanmartin

I have a big div (the blue one) with a ContextMenu and inside another div (green one) with another contextmenu. Both contextmenu shows with right click.

If I make a right clic in the blue div the ContextMenu shows fine. But when I clic in the green div still appears the old contextmenu. If I refresh the page and just clic in the green div, it shows the correct contextMenu.

I made this example http://jsfiddle.net/german_martin/oprkvys1/ of my problem.

ITEM 1
<div class="SingleItem">ITEM 2</div> 
<div class="SingleItem">ITEM 3</div> 
</div>

$(document).ready(function () {

$.contextMenu({
    selector: '.CuadroFondo',
    callback: function (key, options) {

        if (key == "expand") {
            alert("expand");
        }

        if (key == "creargrupo") {
            alert("creargrupo");
        }

        if (key == "seguridadgrupo") {
            alert("jejeje")
        }

    },
    items: {
        "expand": { name: "Irak", icon: "add-expand" },
        "sep1": "--MAIN MENU--",
        "creargrupo": { name: "Afganistan", icon: "crearnuevo" },


    }
});


$.contextMenu({
    selector: '.SingleItem',
    callback: function (key, options) {

        if (key == "expand") {
            alert("expand");
        }

        if (key == "creargrupo") {
            alert("creargrupo");
        }

        if (key == "seguridadgrupo") {
            alert("jejeje")
        }

    },
    items: {
        "expand": { name: "Miami", icon: "add-expand" },
        "sep1": "--SUBMENU--",
        "seguridadgrupo": { name: "Florida", icon: "seguridad" }

    }
});

})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions