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

click action not fired in MenuItem #52

Open
mdings opened this issue Apr 2, 2020 · 0 comments
Open

click action not fired in MenuItem #52

mdings opened this issue Apr 2, 2020 · 0 comments

Comments

@mdings
Copy link

mdings commented Apr 2, 2020

In my javascript file I use the code below to trigger a context menu. Notice that I used two different methods to trigger the click, however none of them work. The context menu is displaying as it should btw, just the click handlers are not triggered. How should this be done?

    const asyncDeskgap = deskgap.asyncNode
    const curWin = asyncDeskgap.getCurrentWindow()
    asyncDeskgap.require('deskgap').then(deskgap => {
        deskgap.prop('Menu')
            .invoke('buildFromTemplate', 
                [{ 
                    'label': 'label one', 
                    onClick() {
                        console.log('click')
                    } 
                }, {
                    'type': 'separator'
                }, { 
                    'label': 'label two', 
                    click() {
                        console.log('k do this')
                    } 
                }])
            .invoke('popup', curWin).value()
    })
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