I want to remove items from the context menu and replace them with custom entries. I've managed to add the custom entries, but I haven't figured out how to remove some of the default options (Edit Link, Unlink, etc). Also, is it possible to reorder the context menu to insert the custom entries amongst the default menu items?
Thu, 07/15/2010 - 14:56
#1
Re: Removing items from context menu
IE
group: 'image' //have to be added in config
would add the item to the image group, and would appear where the image context item currently is. Unforunately I don't remember where the groups are defined off-hand. You can always look at the plugin definition of the plugin you want to put it next to and do it that way.
As for removing listeners, I assume you don't want to remove the actual plugin. So I looked at the contextxmenu plugin, and it doesn't appear that the prototype allows for the removal of items, but you could look at the this._.listeners variable and maybe destroy them manually there. You'd have to loop through them though, and since they are anonomous functions...that could get very tricky. If you end up doing that, share your code as I'm sure many others would be interested.
Re: Removing items from context menu