swisnl / jQuery-contextMenu

jQuery contextMenu plugin & polyfill
https://swisnl.github.io/jQuery-contextMenu/
MIT License
2.24k stars 744 forks source link

Can not hide contextMenu after clicking an item #622

Closed gasparyanyur closed 6 years ago

gasparyanyur commented 6 years ago
{
                selector: '.file-context',
                autoHide:true,
                callback: function (key, options) {
                    var id = options.$trigger.data('id');
                    if (key === 'download') {
                        $storage.FileDownload()
                    } else if (key === 'delete') {
                        $storage.DeleteFileFolder(options.$trigger);
                    } else if (key === 'share') {
                        $storage.ShareNode(options.$trigger);
                    } else if (key === 'rename') {
                        $storage.RenameNode(options.$trigger);
                    }
                },
                items: {
                    "rename": {name: '{{trans('messages.events.rename')}}'},
                    "download": {name: '{{trans('messages.events.download')}}'},
                    "delete": {name: '{{trans('messages.events.delete')}}'},
                    "share": {name: '{{trans('messages.events.share')}}'}
                }
            }

Here is my options object. So I want to after clicking on one of the menu items, to hide context menu

bbrala commented 6 years ago

You should return true/false in the callback i think.

http://swisnl.github.io/jQuery-contextMenu/docs.html#callback

bbrala commented 6 years ago

Closed due to inactivity.