Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant