TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

onContextMenuShow

onContextMenuShow

The function called when the context menu has been shown.

If a plugin is listening for this event, it must call the AddContextMenuItem method (synchronously or not), because the editor waits for responses from all plugins before filling the context menu.

Parameters:

Name Type Description
options ContextMenuOptions

Defines the context menu information.

Example

Copy code
window.Asc.plugin.attachEvent('onContextMenuShow', function(options) {
	if (!options) return;

	if (options.type === 'Selection' || options.type === 'Target')
		this.executeMethod('AddContextMenuItem', [getContextMenuItems()]);
});