electron client: add "cut" action to context menu
This commit is contained in:
parent
19bbc1216c
commit
58af556065
1 changed files with 4 additions and 2 deletions
|
|
@ -135,11 +135,13 @@ module.exports = function(options={}) {
|
|||
})
|
||||
|
||||
var menu = new Menu()
|
||||
menu.append(new MenuItem({role: 'cut'}))
|
||||
menu.append(new MenuItem({role: 'copy'}))
|
||||
menu.append(new MenuItem({role: 'paste'}))
|
||||
window.webContents.on('context-menu', (e, data) => {
|
||||
menu.items[0].enabled = data.editFlags.canCopy
|
||||
menu.items[1].enabled = data.editFlags.canPaste
|
||||
menu.items[0].enabled = data.editFlags.canPaste
|
||||
menu.items[1].enabled = data.editFlags.canCopy
|
||||
menu.items[2].enabled = data.editFlags.canPaste
|
||||
menu.popup({window: window, x: e.x, y: e.y })
|
||||
}, false)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue