1. Open CKEditor with standard toolbar
2. Try going to commands for current instance and call command.disable()
for each item in commands
3. It will disable almost all but few buttons on toolbar
I have tried solution provided by garry.yao on the following link:
http://ckeditor.com/forums/CKEditor-3.x/How-make-CKEditor-readonly
== Expected result ==
I want way to disable font and fontsize button
== Actual result ==
No option available through commands collection
== Other details (browser, OS, CKEditor version, installed plugins) ==
--
Ticket URL: <http://dev.ckeditor.com/ticket/13852>
CKEditor <http://ckeditor.com/>
The text editor for the Internet
* Attachment "table.png" added.
* status: new => confirmed
* version: 4.5.4 => 4.0
Comment:
Ok, to disable toolbar button, you can use api e.g.
{{{
editor.on('instanceReady', function(evt){
this.getCommand( 'justifyleft' ).disable();
this.getCommand( 'newpage' ).disable();
});
}}}
There is however no way to disable dropdowns. They don't use commands.
There could be either some api or dedicated method to do that (but then a
dedicated method for toolbar would have to be introduced).
--
Ticket URL: <http://dev.ckeditor.com/ticket/13852#comment:1>
Comment (by j.swiderski):
Dropdowns are not related to commands so they can only be disabled through
{{{ui}}}. The problem with CKEditor default dropdowns is they are all
context sensitive so as soon as you hit any dropdown matching style, the
dropdown will get enabled again.
{{{
editor.on( 'instanceReady', function( evt ){
editor.ui.instances.FontSize.setState(CKEDITOR.TRISTATE_DISABLED);
});
}}}
The above workaround will only work on custom dropdowns which do not check
current selection in editor contents.
--
Ticket URL: <http://dev.ckeditor.com/ticket/13852#comment:2>