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

Add sending contextmenu event to Desktop app #4063

Merged
merged 4 commits into from
Mar 16, 2016

Conversation

mkaz
Copy link
Contributor

@mkaz mkaz commented Mar 15, 2016

In order to display the contextmenu within the visual editor, since it is in an iframe, we need to send the contextmenu event up to the app using IPC. With the Desktop app changes in Automattic/wp-desktop#116 the Context Menu will include spelling suggestions and copy/paste functionality.

@mkaz mkaz added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 15, 2016
@mkaz mkaz changed the title Add sending contextmenu event to Desktop Add sending contextmenu event to Desktop app Mar 15, 2016
if ( config.isEnabled( 'desktop' ) ) {
const ipc = require( 'electron' ).ipcRenderer; // From Electron
editor.on( 'contextmenu', function( ev ) {
ipc.send( 'mce-context-menu', ev );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably name the event mce-contextmenu for consistency.

@mjangda
Copy link
Member

mjangda commented Mar 16, 2016

One small naming thing, but otherwise 👍

mjangda referenced this pull request in Automattic/wp-desktop Mar 16, 2016
@mkaz mkaz removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 16, 2016
mkaz added a commit that referenced this pull request Mar 16, 2016
Add sending contextmenu event to Desktop app
@mkaz mkaz merged commit 230e142 into master Mar 16, 2016
@lancewillett lancewillett deleted the add/editor/desktop-context-menu branch March 24, 2016 18:05
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

Successfully merging this pull request may close these issues.

2 participants