Electron: Undo/redo support?

Created on 8 Nov 2015  ·  3Comments  ·  Source: electron/electron

I notice in electron/atom/browser/api/lib/menu-item.coffee and in other places in the codebase that there are references to the undo and redo menu items under Edit.

How do I provide a function to be called when these menu items are selected (or the shortcut is pressed)?

Most helpful comment

Is there any way to access the event for roles like undo/redo so that we can have a custom undo/redo stack?

All 3 comments

@christiangenco checkout menu and menu-item packages. There are undo and redo menu-item roles to handle undo/redo actions.

Under the hood it is calling webContents.undo().
http://electron.atom.io/docs/v0.34.0/api/web-contents/#webcontents-undo

Is there any way to access the event for roles like undo/redo so that we can have a custom undo/redo stack?

Was this page helpful?
0 / 5 - 0 ratings