I have added a custom contextmenuitem but I only want it to be displayed on a specific element not everywhere, how is this possible? Currently it is shown on every element when i rightclick.
My current code includes this:
CKEDITOR.plugins.add('newplugin',
{
requires: ['htmlwriter'],
init: function(editor) {
var pluginName = 'newplugin';
editor.addCommand('abbrDialog', new CKEDITOR.dialogCommand('abbrDialog'));
editor.ui.addButton('Newplugin',
{
label: 'Försäkringsinnehav',
command: 'abbrDialog',
icon: 'templates'
});
editor.addMenuGroup('abbrGroup');
editor.contextMenu.addListener(function(element, selection) {
return {
myCommand: CKEDITOR.TRISTATE_OFF
};
});
editor.addMenuItems({
myCommand: {
label: "Edit properties",
command: 'abbrDialog',
group: 'abbrGroup',
order: 1
}});
editor.removeMenuItem('image');
editor.on('doubleclick', function(evt)
{
evt.data.dialog = 'abbrDialog';
});
editor.dataProcessor = new CKEDITOR.customprocessor(editor);
}
});
How can I make the contextmenuchanges only appear on a specific element?
