Opened 9 years ago
Last modified 7 years ago
#13852 confirmed New Feature
There is no way to disable the font and fontsize button on the toolbar
Reported by: | Ramendra | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 |
Keywords: | Cc: | ramendra.kotharkar@… |
Description
Steps to reproduce
- Open CKEditor with standard toolbar
- Try going to commands for current instance and call command.disable() for each item in commands
- 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)
Attachments (1)
Change History (3)
Changed 9 years ago by
comment:1 Changed 9 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.5.4 → 4.0 |
comment:2 Changed 7 years ago by
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.
Ok, to disable toolbar button, you can use api e.g.
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).