I am using CKEDITOR 3.6.
I want to remove an ‘Anchor’ plugin from the toolbar configuration based on some condition. I am adding the toolbar values as below.
var isAnchor="False";
config.toolbar = 'MyconfigTool';
switch (toolbarType) {
case "formatLink":
config.toolbar_MyconfigTool= [
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Link', 'Unlink', 'Anchor']
]
break;
case "findLink":
config.toolbar_MyconfigTool= [
['Find', 'Replace', '-', 'SelectAll'],
['Link', 'Unlink', 'Anchor']
]
break;
}
And now i want to remove that added ‘Anchor’ plugin from that toolbar if isAnchor='false'.
How can i do this.
I have tried the following but i can’t success
if(isAnchor== 'False'){
config.removePlugins = 'Anchor';
}
And i dont want to rebuild that toolbar again. I just want to remove that added plugin.
You can’t just “rebuild” toolbar. You would have to hack the source pretty badly to achieve that. Normally, entire editor has to be reinitialized with the new toolbar config.