Opened 4 years ago

Closed 3 years ago

#8959 closed Task (invalid)

How to make particular custom buttons/command enabled in readonly mode

Reported by: enorth Owned by:
Priority: Normal Milestone:
Component: UI : Skins Version: 3.6.3
Keywords: Cc:


I noticed that when you make the editor readonly some of the command buttons (such as copy, preview, full screen) stay enabled. I have two questions:

  1. What class/property do I need to set for my user-defined, custom buttons/commands (plugins) to have them behave this way?
  2. How can I override this behavior. In other words, make copy, preview, full screen disabled when the editor is readonly.

I had some partial success. I tried adding a class called "alwaysEnabled" when creating the button (editor.ui.addButton). Then after I made the editor readonly, I executed this command:


This made it "appear" enabled, but the command still din not fire.

thanks for help.

Change History (3)

comment:1 Changed 4 years ago by enorth

  • Component changed from General to UI : Skins
  • Type changed from Bug to Task
  • Version set to 3.6.3

comment:3 Changed 3 years ago by j.swiderski

  • Resolution set to invalid
  • Status changed from new to closed

Please refer to the following article for information on where to get support for all issues related to CKEditor:

Also try using our forums for advice:

If you are looking for professional assistance, the CKEditor development team is available via a dedicated support channel that is included in all our commercial licenses:

Further more I believe that it was answered on forum:

Whether a custom plugin will be disabled in read-only depends on your plugin's definitions. The Source, Preview, etc., buttons are attached to editor "commands" and they reflect the command "state".

When defining a command it is possible to mark it as valid for read-only, by setting the readOnly property of the command definition to 1 or true.

For example, you can see this happening on the preview plugin code, at line 16:

So I guess the class/property you are looking for is readOnly : 1 in your plugin's js file.

Note: See TracTickets for help on using tickets.
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy