Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto hide does not work for children elements #727

Open
Arimov opened this issue Jul 13, 2020 · 0 comments
Open

Auto hide does not work for children elements #727

Arimov opened this issue Jul 13, 2020 · 0 comments

Comments

@Arimov
Copy link

Arimov commented Jul 13, 2020

My case: I want the user to right-click on a row in the table or left-click on a button in this row.
In this configuration, the autoHide for the internal element does not work. Perhaps this can be fixed somehow?
Example:

<span class="context-menu-two">Click me right! 
       <span class="context-menu-one">Click me!</span>
</span>

JavaScript:

           $(function() {
                $.contextMenu({
                    selector: '.context-menu-one', 
                    autoHide: true,
                    trigger: 'left',
                    callback: function(key, options) {
                        var m = "clicked: " + key;
                        window.console && console.log(m) || alert(m); 
                    },
                    items: {
                        "edit": {name: "Edit", icon: "edit"},
                        "cut": {name: "Cut", icon: "cut"},
                    copy: {name: "Copy", icon: "copy"},
                        "paste": {name: "Paste", icon: "paste"},
                        "delete": {name: "Delete", icon: "delete"},
                        "sep1": "---------",
                        "quit": {name: "Quit", icon: function(){
                            return 'context-menu-icon context-menu-icon-quit';
                        }}
                    }
                });


            });


            $(function() {
                $.contextMenu({
                    selector: '.context-menu-two', 
                    autoHide: true,
                    trigger: 'right',
                    callback: function(key, options) {
                        var m = "clicked: " + key;
                        window.console && console.log(m) || alert(m); 
                    },
                    items: {
                        "edit": {name: "Edit", icon: "edit"},
                        "cut": {name: "Cut", icon: "cut"},
                    copy: {name: "Copy", icon: "copy"},
                        "paste": {name: "Paste", icon: "paste"},
                        "delete": {name: "Delete", icon: "delete"},
                        "sep1": "---------",
                        "quit": {name: "Quit", icon: function(){
                            return 'context-menu-icon context-menu-icon-quit';
                        }}
                    }
                });


            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant